class xattr

Function set for working with file extended attributes.

See Also:

man xattr

static ubyte[] read(string path, string key)

Gets value of the required extended attribute.

Parameters

path

Path to explored file. If it's a symlink, the target will be used.

key

Attribute name.

Returns

read value.

static void set(string path, string key, const ubyte[] value)

Sets new value of the required extended attribute.

Parameters

path

Path to explored file. If it's a symlink, the target will be used.

key

Attribute name. If the attribute doesn't exist, it will be created.

value

New value of the attribute.

static void set(string path, string key, string value)

Sets new value of the required extended attribute.

Parameters

path

Path to explored file. If it's a symlink, the target will be used.

key

Attribute name. If the attribute doesn't exist, it will be created.

value

New value of the attribute.

static void remove(string path, string key)

Removes the requested attribute.

Parameters

path

Path to file. If it's a symlink, the target will be used.

key

Attribute name.

static string[] getAttrs(string path)

Reads list of all attributes.

Parameters

path

Path to explored file. If it's a symlink, the target will be used.

Returns

extended attributes of the specified file.

static ubyte[][string] getAttrsAndValues(string path)

Creates associative array with attribute names and attribute values.

Parameters

path

Path to explored file. If it's a symlink, the target will be used.

Returns

all extended attributes and their values of the specified file.