FileT.setAttribute

Sets an attribute in the file with attribute name @attribute to @value.

Some attributes can be unset by setting @attribute to %G_FILE_ATTRIBUTE_TYPE_INVALID and @value_p to %NULL.

If @cancellable is not %NULL, then the operation can be cancelled by triggering the cancellable object from another thread. If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.

template FileT(TStruct)
bool
setAttribute

Parameters

attribute string

a string containing the attribute's name

type GFileAttributeType

The type of the attribute

valueP void*

a pointer to the value (or the pointer itself if the type is a pointer type)

flags GFileQueryInfoFlags

a set of #GFileQueryInfoFlags

cancellable Cancellable

optional #GCancellable object, %NULL to ignore

Return Value

Type: bool

%TRUE if the attribute was set, %FALSE otherwise.

Throws

GException on failure.

Meta