Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gfxattr(1) [debian man page]

GFXATTR(1)																GFXATTR(1)

NAME
gfxattr - Manipulate extended attributes in Gfarm file system SYNOPSIS
gfxattr [ -s | -g | -l | -r ] [ -x ] [ -c | -m ] [ -f xattrfile ] file [ xattrname ] DESCRIPTION
gfxattr manipulates extended attributes and XML extended attributes of a specified file. An extended attribute consists of an attribute name and an attribute value, which are arbitrary strings. An XML extended attribute is an extended attribute having an XML attribute value. Since XML extended attributes have a different name space from extended attributes, the same attribute name can be used. When the -x option is specified, XML extended attributes are manipulated. It is possible to search XML extended attributes by XPath query using gffindxmlattr command. All files and directories in Gfarm file system can keep extended attributes. When removing a file or directory, the associated extended attributes are also removed. Either -s, -g, -l, or -r option should be specified. OPTIONS
-s sets a new value with an extended attribute xattrname for a specified file. With the -f option, the value can be specified by the file xattrfile instead of by the standard input. When neither -c nor -m option is specified, the extended attribute is overwritten if it is already set. -g reads a value with an extended attribute xattrname for a specified file. -l display a list of extended attributes for a specified file. -r removes a extended attribute xattrname for a specified file. -x manipulates XML extended attributes. -c sets a new extended attribute if it is not set. This option is used with the -s option. -m modifies the extended attribute if there it is. This option is used with the -s option. -f xattrfile With the -s option, reads an extended attribute from the specified xattrfile instead of from the standard input. With the -g option, writes the extended attribute to the specified xattrfile instead of to the standard output. -? displays usage. SEE ALSO
gffindxmlattr(1) Gfarm 18 August 2009 GFXATTR(1)

Check Out this Related Man Page

XATTR_SET(3)								 1							      XATTR_SET(3)

xattr_set - Set an extended attribute

SYNOPSIS
bool xattr_set (string $filename, string $name, string $value, [int $flags]) DESCRIPTION
This function sets the value of an extended attribute of a file. Extended attributes have two different namespaces: user and root. The user namespace is available to all users, while the root namespace is available only to users with root privileges. xattr operates on the user namespace by default, but this can be changed with the $flags parameter. PARAMETERS
o $filename - The file in which we set the attribute. o $name - The name of the extended attribute. This attribute will be created if it doesn't exist or replaced otherwise. You can change this behaviour by using the $flags parameter. o $value - The value of the attribute. o $flags - Supported xattr flags +-----------------+---------------------------------------------------+ | | | | XATTR_CREATE | | | | | | | Function will fail if extended attribute already | | | exists. | | | | | | | | XATTR_REPLACE | | | | | | | Function will fail if extended attribute doesn't | | | exist. | | | | | | | |XATTR_DONTFOLLOW | | | | | | | Do not follow the symbolic link but operate on | | | symbolic link itself. | | | | | | | | XATTR_ROOT | | | | | | | Set attribute in root (trusted) namespace. | | | Requires root privileges. | | | | +-----------------+---------------------------------------------------+ RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Sets extended attributes on .wav file <?php $file = 'my_favourite_song.wav'; xattr_set($file, 'Artist', 'Someone'); xattr_set($file, 'My ranking', 'Good'); xattr_set($file, 'Listen count', '34'); /* ... other code ... */ printf("You've played this song %d times", xattr_get($file, 'Listen count')); ?> SEE ALSO
xattr_get(3), xattr_remove(3). PHP Documentation Group XATTR_SET(3)
Man Page