Inherits from NSObject
Declared in DTExtendedFileAttributes.h

Overview

This class provides read/write access to extended file attributes of a file or folder. It wraps the standard xattr Posix functions to do that.

Because the file system does not keep track of the data types saved in extended attributes this API so far reads and writes strings.

Tasks

Creating an Extended File Attribute Manager

Reading/Writing Extended Attributes

Instance Methods

initWithPath:

Creates an Extended File Attribute Manager.

- (id)initWithPath:(NSString *)path

Parameters

path

The file path

Declared In

DTExtendedFileAttributes.h

removeAttribute:

Removes an extended file attribute from the receiver.

- (BOOL)removeAttribute:(NSString *)attribute

Parameters

attribute

The name of the attribute.

Return Value

YES if successful.

Declared In

DTExtendedFileAttributes.h

setValue:forAttribute:

Sets the value of an extended file attribute for the receiver.

- (BOOL)setValue:(NSString *)value forAttribute:(NSString *)attribute

Parameters

value

The string to save for this attribute.

attribute

The name of the attribute.

Return Value

YES if successful.

Discussion

If the value is nil then this is the same as calling removeAttribute:.

Declared In

DTExtendedFileAttributes.h

valueForAttribute:

Gets the value of an extended file attribute from the receiver.

- (NSString *)valueForAttribute:(NSString *)attribute

Parameters

attribute

The name of the attribute.

Return Value

The string for the value or nil if the value is not set.

Declared In

DTExtendedFileAttributes.h