Platforms to show: All Mac Windows Linux Cross-Platform

ExtendedAttributesMBS.Available as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: Returns true if extended attribute functions are available.

Feedback, Comments & Corrections

ExtendedAttributesMBS.GetAttribute(path as folderitem, name as string, options as Integer = 0) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No No Yes, macOS only No
Function: Get an extended attribute value.
Example:
Dim f As FolderItem = SpecialFolder.Desktop.Child("test.txt")
// query attribute
Dim v As Variant = ExtendedAttributesMBS.GetAttribute(f, "com.apple.metadata:_kMDItemUserTags")

// plugin converts it to Xojo data types with variants
If v <> Nil Then
// tags should be an array of Variant with strings
Dim a() As Variant = v

For Each s As String In a
MsgBox s
Next
End If
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes of files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

The GetAttribute function retrieves all bytes of data from the extended attribute identified by name associated with path.

An extended attribute's name is a simple UTF-8 string. position specifies an offset within the extended attribute. In the current implementation, this argument is only used with the resource fork attribute. For all other extended attributes, this parameter is reserved and should be zero.

On success, returns the data associated with name.

Options specify options for retrieving extended attributes:
kNoFollowDo not follow symbolic links. getxattr() normally returns information from the target of path if it is a symbolic link. With this option, GetAttribute will return extended attribute data from the symbolic link instead.
kShowCompression: GetAttribute will return HFS Plus Compression extended attribute name (if present) for the file referred to by path or fd.

On success, the value is returned. On failure, nil is returned and lasterror is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.GetAttribute(path as string, name as string, options as Integer = 0) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No No Yes, macOS only No
Function: Get an extended attribute value.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
dim v as Variant = ExtendedAttributesMBS.GetAttribute(f, ExtendedAttributesMBS.kAttributeNameFinderComment)
break // see comment string in debugger
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes of files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

The GetAttribute function retrieves all bytes of data from the extended attribute identified by name associated with path.

An extended attribute's name is a simple UTF-8 string. position specifies an offset within the extended attribute. In the current implementation, this argument is only used with the resource fork attribute. For all other extended attributes, this parameter is reserved and should be zero.

On success, returns the data associated with name.

Options specify options for retrieving extended attributes:
kNoFollowDo not follow symbolic links. getxattr() normally returns information from the target of path if it is a symbolic link. With this option, GetAttribute will return extended attribute data from the symbolic link instead.
kShowCompression: GetAttribute will return HFS Plus Compression extended attribute name (if present) for the file referred to by path or fd.

On success, the value is returned. On failure, nil is returned and lasterror is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.GetRawAttribute(path as folderitem, name as string, options as Integer = 0) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: Get an extended attribute value.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
dim value as MemoryBlock = ExtendedAttributesMBS.GetRawAttribute(f, ExtendedAttributesMBS.kAttributeNameFinderInfo)
break // see in debugger
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes of files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

The GetRawAttribute function retrieves all bytes of data from the extended attribute identified by name associated with path.

An extended attribute's name is a simple UTF-8 string. position specifies an offset within the extended attribute. In the current implementation, this argument is only used with the resource fork attribute. For all other extended attributes, this parameter is reserved and should be zero.

On success, returns the data associated with name.

Options specify options for retrieving extended attributes:
kNoFollowDo not follow symbolic links. getxattr() normally returns information from the target of path if it is a symbolic link. With this option, GetRawAttribute will return extended attribute data from the symbolic link instead.
kShowCompression: GetRawAttribute will return HFS Plus Compression extended attribute name (if present) for the file referred to by path or fd.

On success, the value is returned. On failure, nil is returned and lasterror is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.GetRawAttribute(path as string, name as string, options as Integer = 0) as memoryblock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: Get an extended attribute value.
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes of files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

The GetRawAttribute function retrieves all bytes of data from the extended attribute identified by name associated with path.

An extended attribute's name is a simple UTF-8 string. position specifies an offset within the extended attribute. In the current implementation, this argument is only used with the resource fork attribute. For all other extended attributes, this parameter is reserved and should be zero.

On success, returns the data associated with name.

Options specify options for retrieving extended attributes:
kNoFollowDo not follow symbolic links. getxattr() normally returns information from the target of path if it is a symbolic link. With this option, GetRawAttribute will return extended attribute data from the symbolic link instead.
kShowCompression: GetRawAttribute will return HFS Plus Compression extended attribute name (if present) for the file referred to by path or fd.

On success, the value is returned. On failure, nil is returned and lasterror is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.LastError as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: The last error code.
Notes:
Possible error values:
EPERM1Attributes cannot be associated with this type of object. For example, attributes are not allowed for resource forks.
EIO5An I/O error occurred while reading from or writing to the file system.
E2BIG7The data size of the extended attribute is too large.
EACCES13Permissions denied
EFAULT14path or name points to an invalid address.
EEXIST17options contains XATTR_CREATE and the named attribute already exists.
ENOTDIR20A component of path's prefix is not a directory.
EISDIR21path or fd do not refer to a regular file and the attribute in question is only applicable to files. Similar to EPERM.
EINVAL22name or options is invalid. name must be valid UTF-8 and options must make sense.
ENOSPC28Not enough space left on the file system.
EROFS30The file system is mounted read-only.
ERANGE34The data size of the attribute is out of range (some attributes have size restrictions).
ENOTSUP45The file system does not support extended attributes or has the feature disabled.
ELOOP62Too many symbolic links were encountered resolving path.
ENAMETOOLONG63Name exceeded XATTR_MAXNAMELEN UTF-8 bytes, or a component of path exceeded NAME_MAX characters, or the entire path exceeded PATH_MAX characters.
ENOATTR93options is set to kReplace and the named attribute does not exist.

Feedback, Comments & Corrections

ExtendedAttributesMBS.LastErrorMessage as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 13.5 Yes No Yes Yes No
Function: The error message for the last error.

Feedback, Comments & Corrections

ExtendedAttributesMBS.ListAttributes(path as folderitem, Options as Integer = 0) as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: List extended attribute names.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
dim names() as string = ExtendedAttributesMBS.ListAttributes(f, ExtendedAttributesMBS.kNoFollow+ExtendedAttributesMBS.kShowCompression)
MsgBox Join(names, EndOfLine)
Notes:
Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

ListAttributes retrieves a list of names of extended attributes associated with the given path in the file system. The list will only include names of extended attributes to which the calling process has access.

Options controls how the attribute list is generated:

kNoFollow: Do not follow symbolic links. ListAttributes normally lists attributes of the target of path if it is a symbolic link. With this option, ListAttributes will list attributes of the link itself.
kShowCompression: ListAttributes will list HFS Plus Compression extended attribute(s) (if present) for the file referred to by path.

On success returns array with names. If no accessible extended attributes are associated with the given path, the function returns empty array. Lasterror is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.ListAttributes(path as string, Options as Integer = 0) as string()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: List extended attribute names.
Notes:
Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

ListAttributes retrieves a list of names of extended attributes associated with the given path in the file system. The list will only include names of extended attributes to which the calling process has access.

Options controls how the attribute list is generated:

kNoFollow: Do not follow symbolic links. ListAttributes normally lists attributes of the target of path if it is a symbolic link. With this option, ListAttributes will list attributes of the link itself.
kShowCompression: ListAttributes will list HFS Plus Compression extended attribute(s) (if present) for the file referred to by path.

On success returns array with names. If no accessible extended attributes are associated with the given path, the function returns empty array. Lasterror is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.RemoveAttribute(path as folderitem, name as string, options as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: Remove an extended attribute value.
Notes:
Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

RemoveAttribute deletes the extended attribute name associated with path.

An extended attribute's name is a simple UTF-8 string. Options is a bit mask specifying various options:

kNoFollowDo not follow symbolic links. Normally, removexattr() acts on the target of path if it is a symbolic link. With this option, RemoveAttribute will act on the link itself.
kShowCompression: RemoveAttribute will remove HFS Plus Compression extended attribute name (if present) for the file referred to by path or fd.

On success, true is returned. On failure, false is returned and the lasterror value is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.RemoveAttribute(path as string, name as string, options as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: Remove an extended attribute value.
Notes:
Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

RemoveAttribute deletes the extended attribute name associated with path.

An extended attribute's name is a simple UTF-8 string. Options is a bit mask specifying various options:

kNoFollowDo not follow symbolic links. Normally, removexattr() acts on the target of path if it is a symbolic link. With this option, RemoveAttribute will act on the link itself.
kShowCompression: RemoveAttribute will remove HFS Plus Compression extended attribute name (if present) for the file referred to by path or fd.

On success, true is returned. On failure, false is returned and the lasterror value is set.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.SetAttribute(path as folderitem, name as string, data as Variant, options as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No No Yes, macOS only No
Function: Set an extended attribute value.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.txt")
call ExtendedAttributesMBS.SetAttribute(f, ExtendedAttributesMBS.kAttributeNameFinderComment, "Test Comment")
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

SetAttribute associates name and data together as an attribute of path.

An extended attribute's name is a simple UTF-8 string. Data is a memoryblock with the data and contains textual or binary data to be associated with the extended attribute. Position specifies the offset within the extended attribute. In the current implementation, only the resource fork extended attribute makes use of this argument. For all others, position is reserved and should be set to zero.

Options controls how the attribute is set:
kNoFollowDo not follow symbolic links. SetAttribute normally sets attributes on the target of path if it is a symbolic link. With this option, SetAttribute will act on the link itself.
kCreateFail if the named attribute already exists.
kReplaceFail if the named attribute does not exist. Failure to specify kReplace or kCreate allows creation and replacement.

On some filesystems, such as HFS+, setting the extended attribute com.apple.ResourceFork will update the modification time of the file.

Returns true on success and false on failure. Lasterror is set.
You may need to inform other applications like Finder that file changed and attributes need to be read.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.SetAttribute(path as string, name as string, data as Variant, options as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No No Yes, macOS only No
Function: Set an extended attribute value.
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

SetAttribute associates name and data together as an attribute of path.

An extended attribute's name is a simple UTF-8 string. Data is a memoryblock with the data and contains textual or binary data to be associated with the extended attribute. Position specifies the offset within the extended attribute. In the current implementation, only the resource fork extended attribute makes use of this argument. For all others, position is reserved and should be set to zero.

Options controls how the attribute is set:
kNoFollowDo not follow symbolic links. SetAttribute normally sets attributes on the target of path if it is a symbolic link. With this option, SetAttribute will act on the link itself.
kCreateFail if the named attribute already exists.
kReplaceFail if the named attribute does not exist. Failure to specify kReplace or kCreate allows creation and replacement.

On some filesystems, such as HFS+, setting the extended attribute com.apple.ResourceFork will update the modification time of the file.

Returns true on success and false on failure. Lasterror is set.
You may need to inform other applications like Finder that file changed and attributes need to be read.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.SetRawAttribute(path as folderitem, name as string, data as memoryblock, options as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: Set an extended attribute value.
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

SetRawAttribute associates name and data together as an attribute of path.

An extended attribute's name is a simple UTF-8 string. Data is a memoryblock with the data and contains textual or binary data to be associated with the extended attribute. Position specifies the offset within the extended attribute. In the current implementation, only the resource fork extended attribute makes use of this argument. For all others, position is reserved and should be set to zero.

Options controls how the attribute is set:
kNoFollowDo not follow symbolic links. SetRawAttribute normally sets attributes on the target of path if it is a symbolic link. With this option, SetRawAttribute will act on the link itself.
kCreateFail if the named attribute already exists.
kReplaceFail if the named attribute does not exist. Failure to specify kReplace or kCreate allows creation and replacement.

On some filesystems, such as HFS+, setting the extended attribute com.apple.ResourceFork will update the modification time of the file.

Returns true on success and false on failure. Lasterror is set.
You may need to inform other applications like Finder that file changed and attributes need to be read.

See also:

Feedback, Comments & Corrections

ExtendedAttributesMBS.SetRawAttribute(path as string, name as string, data as memoryblock, options as Integer = 0) as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Files MBS MacOSX Plugin 12.5 Yes No Yes Yes No
Function: Set an extended attribute value.
Notes:
On Mac the extended attributes are normally formatted property lists, so please use the high level functions SetAttribute/GetAttribute. Raw functions are better for things like resourcefork or FinderInfo.

Extended attributes extend the basic attributes associated with files and directories in the file system. They are stored as name:data pairs associated with file system objects (files, directories, symlinks, etc).

SetRawAttribute associates name and data together as an attribute of path.

An extended attribute's name is a simple UTF-8 string. Data is a memoryblock with the data and contains textual or binary data to be associated with the extended attribute. Position specifies the offset within the extended attribute. In the current implementation, only the resource fork extended attribute makes use of this argument. For all others, position is reserved and should be set to zero.

Options controls how the attribute is set:
kNoFollowDo not follow symbolic links. SetRawAttribute normally sets attributes on the target of path if it is a symbolic link. With this option, SetRawAttribute will act on the link itself.
kCreateFail if the named attribute already exists.
kReplaceFail if the named attribute does not exist. Failure to specify kReplace or kCreate allows creation and replacement.

On some filesystems, such as HFS+, setting the extended attribute com.apple.ResourceFork will update the modification time of the file.

Returns true on success and false on failure. Lasterror is set.
You may need to inform other applications like Finder that file changed and attributes need to be read.

See also:

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS MacOSX Plugin.

The biggest plugin in space...




Links
MBS Xojo Chart Plugins