Purpose
Lists the tag names assigned to an Oracle ACFS file. For additional information, refer to "acfsutil tag info".
Syntax
sb8 acfslisttags(const oratext *path, oratext *list, size_t size, ub4 flags);
Table 18-3 contains the options available with the acfslisttags
command.
Table 18-4 Options for the acfslisttags command
Option | Description |
---|---|
|
Specifies a pointer to a file or directory path name. |
|
Specifies a pointer to a memory buffer containing the list of Oracle ACFS tag names. |
|
Specifies the size (bytes) of the memory buffer that holds the returned Oracle ACFS tag name list. |
|
Reserved for future use. Must be set to 0. |
Description
The acfslisttags
library call retrieves all the tag names assigned to an Oracle ACFS file. acfslisttags
returns a list of tag names into the list
memory buffer. Each tag name in the list is terminated with a NULL. If a file has no tag names then the list is empty. The memory buffer must be large enough to hold all of the tag names assigned to an Oracle ACFS file.
An application must allocate a buffer and specify a list size large enough to hold all of the tag names assigned to an Oracle ACFS file. An application can optionally obtain the list buffer size needed by first calling acfslisttags
with a zero value buffer size and NULL list buffer. The application then checks for nonzero, positive list size return values to allocate a list buffer and call acfslisttags
to retrieve the actual tag name list.
On success, the return value is a positive byte size of the tag name list or 0
when the file has no tag names. On failure, the return value is ACFS_TAG_FAIL
. For information about operating system-specific extended error information values that may be obtained when an ACFS_TAG_FAIL
is returned, refer to "Oracle ACFS Tagging Error Values".
Examples
Example 18-4 is an example of the use of the acfslisttags
function call.
Example 18-4 Listing file tags
sb8 listsize; sb8 listsize2; const oratext *path = "/mnt/dir1/dir2/file2"; oratext *list; /* Determine size of buffer to store list */ listsize = acfslisttags (path, NULL, 0, 0); if (listsize == ACFS_TAG_FAIL) /* retrieve the error code and return */ if (listsize) { list = malloc(listsize) /* Retrieve list of tag names */ listsize2 = acfslisttags (path, list, listsize, 0); if (listsize2 == ACFS_TAG_FAIL) /* check errno or GetLastError() to process error returns */ if (listsize2 > 0) /* file has a list of tag names to process */ else /* file has no tag names. */ } else /* file has no tag names. */