Manual Pages for UNIX Darwin command on man listxattr
MyWebUniversity

Manual Pages for UNIX Darwin command on man listxattr

LISTXATTR(2) BSD System Calls Manual LISTXATTR(2)

NAME

lliissttxxaattttrr,, fflliissttxxaattttrr - list an extended attribute value

SYNOPSIS

##iinncclluuddee <>

ssizet lliissttxxaattttrr(const char *path, char *namebuf, sizet size, int options); ssizet fflliissttxxaattttrr(int fd, char *namebuf, sizet size, int options);

DESCRIPTION

Extended attributes extend the basic attributes associated with files and

directories in the file system. They are stored as name:data pairs asso-

ciated with file system objects (files, directories, symlinks, etc). lliissttxxaattttrr() retrieves a list of names of extended attributes associated with the given path in the file system. namebuf is a data buffer of size bytes for the names of the extended attributes associated with path. The extended attribute names are simple

NULL-terminated UTF-8 strings and are returned in arbitrary order. No

extra padding is provided between names in the buffer. The list will only include names of extended attributes to which the calling process has access. The function returns the size of the list of names. options controls how the attribute list is generated: XATTRNOFOLLOW do not follow symbolic links. lliissttxxaattttrr() normally lists attributes of the target of path if it is a symbolic link. With this option, lliissttxxaattttrr() will list attributes of the link itself. If namebuf is set to NULL, the function returns the size of the list of extended attribute names. This facility can be used to determine the size of a buffer sufficiently large to hold the names of the attributes currently associated with path. fflliissttxxaattttrr() is identical to lliissttxxaattttrr(), except that it returns the list of extended attribute names associated with the open file referenced by file descriptor fd.

RETURN VALUES

On success, the size of the extended attribute name list is returned. If no accessible extended attributes are associated with the given path or

fd, the function returns zero. On failure, -1 is returned and the global

variable errno is set as follows. EERRRROORRSS [ENOTSUP] The file system does not support extended attributes or has the feature disabled. [ERANGE] namebuf (as indicated by size) is too small to hold the list of names. [EPERM] path or fd refer to a file system object that does not support extended attributes. For example, resource forks don't support extended attributes. [ENOTDIR] A component of path 's prefix is not a directory.

[ENAMETOOLONG] name exceeds XATTRMAXNAMELEN UTF-8 bytes, or a compo-

nent of path exceeds NAMEMAX characters, or the

entire path exceeds PATHMAX characters. [EACCES] Search permission is denied for a component of path or permission is denied to read the list of attributes from this file. [ELOOP] Too many symbolic links were encountered resolving path. [EFAULT] path points to an invalid address. [EIO] An I/O error occurred. [EINVAL] options does not make sense.

SEE ALSO

getxattr(2), removexattr(2), setxattr(2) HISTORY lliissttxxaattttrr() and fflliissttxxaattttrr() first appeared in Mac OS X 10.4. Mac OS X Oct 19, 2004 Mac OS X




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™