ObjFW
Loading...
Searching...
No Matches
Instance Methods | Class Methods | Properties | List of all members
OFFileManager Class Reference

A class which provides management for files, e.g. reading contents of directories, deleting files, renaming files, etc. More...

#include <ObjFW/OFFileManager.h>

Inheritance diagram for OFFileManager:
OFObject <OFObject>

Instance Methods

(OFFileAttributes- attributesOfItemAtPath:
 Returns the attributes for the item at the specified path.
 
(OFFileAttributes- attributesOfItemAtIRI:
 Returns the attributes for the item at the specified IRI.
 
(void) - setAttributes:ofItemAtPath:
 Sets the attributes for the item at the specified path.
 
(void) - setAttributes:ofItemAtIRI:
 Sets the attributes for the item at the specified IRI.
 
(bool) - fileExistsAtPath:
 Checks whether a file exists at the specified path.
 
(bool) - fileExistsAtIRI:
 Checks whether a file exists at the specified IRI.
 
(bool) - directoryExistsAtPath:
 Checks whether a directory exists at the specified path.
 
(bool) - directoryExistsAtIRI:
 Checks whether a directory exists at the specified IRI.
 
(void) - createDirectoryAtPath:
 Creates a directory at the specified path.
 
(void) - createDirectoryAtPath:createParents:
 Creates a directory at the specified path.
 
(void) - createDirectoryAtIRI:
 Creates a directory at the specified IRI.
 
(void) - createDirectoryAtIRI:createParents:
 Creates a directory at the specified IRI.
 
(OFArray *) - contentsOfDirectoryAtPath:
 Returns an array with the items in the specified directory.
 
(OFArray *) - contentsOfDirectoryAtIRI:
 Returns an array with the IRIs of the items in the specified directory.
 
(OFArray *) - subpathsOfDirectoryAtPath:
 Returns an array with all subpaths of the specified directory.
 
(void) - changeCurrentDirectoryPath:
 Changes the current working directory.
 
(void) - changeCurrentDirectoryIRI:
 Changes the current working directory.
 
(void) - copyItemAtPath:toPath:
 Copies a file, directory or symbolic link (if supported by the OS).
 
(void) - copyItemAtIRI:toIRI:
 Copies a file, directory or symbolic link (if supported by the OS).
 
(void) - moveItemAtPath:toPath:
 Moves an item.
 
(void) - moveItemAtIRI:toIRI:
 Moves an item.
 
(void) - removeItemAtPath:
 Removes the item at the specified path.
 
(void) - removeItemAtIRI:
 Removes the item at the specified IRI.
 
(void) - linkItemAtPath:toPath:
 Creates a hard link for the specified item.
 
(void) - linkItemAtIRI:toIRI:
 Creates a hard link for the specified item.
 
(void) - createSymbolicLinkAtPath:withDestinationPath:
 Creates a symbolic link for an item.
 
(void) - createSymbolicLinkAtIRI:withDestinationPath:
 Creates a symbolic link for an item.
 
(OFData *) - extendedAttributeDataForName:ofItemAtPath:
 Returns the extended attribute data for the specified name of the item at the specified path.
 
(void) - getExtendedAttributeData:andType:forName:ofItemAtPath:
 Gets the extended attribute data and type for the specified name of the item at the specified path.
 
(OFData *) - extendedAttributeDataForName:ofItemAtIRI:
 Returns the extended attribute data for the specified name of the item at the specified IRI.
 
(void) - getExtendedAttributeData:andType:forName:ofItemAtIRI:
 Gets the extended attribute data and type for the specified name of the item at the specified IRI.
 
(void) - setExtendedAttributeData:forName:ofItemAtPath:
 Sets the extended attribute data for the specified name of the item at the specified path.
 
(void) - setExtendedAttributeData:andType:forName:ofItemAtPath:
 Sets the extended attribute data for the specified name of the item at the specified path.
 
(void) - setExtendedAttributeData:forName:ofItemAtIRI:
 Sets the extended attribute data for the specified name of the item at the specified IRI.
 
(void) - setExtendedAttributeData:andType:forName:ofItemAtIRI:
 Sets the extended attribute data for the specified name of the item at the specified IRI.
 
(void) - removeExtendedAttributeForName:ofItemAtPath:
 Removes the extended attribute for the specified name of the item at the specified path.
 
(void) - removeExtendedAttributeForName:ofItemAtIRI:
 Removes the extended attribute for the specified name of the item at the specified IRI.
 
- Instance Methods inherited from OFObject
(instancetype) - init
 Initializes an already allocated object.
 
(nullable OFMethodSignature *) - methodSignatureForSelector:
 Returns the method signature for the specified selector.
 
(void) - dealloc
 Deallocates the object.
 
(void) - performSelector:afterDelay:
 Performs the specified selector after the specified delay.
 
(void) - performSelector:withObject:afterDelay:
 Performs the specified selector with the specified object after the specified delay.
 
(void) - performSelector:withObject:withObject:afterDelay:
 Performs the specified selector with the specified objects after the specified delay.
 
(void) - performSelector:withObject:withObject:withObject:afterDelay:
 Performs the specified selector with the specified objects after the specified delay.
 
(void) - performSelector:withObject:withObject:withObject:withObject:afterDelay:
 Performs the specified selector with the specified objects after the specified delay.
 
(void) - performSelector:onThread:waitUntilDone:
 Performs the specified selector on the specified thread.
 
(void) - performSelector:onThread:withObject:waitUntilDone:
 Performs the specified selector on the specified thread with the specified object.
 
(void) - performSelector:onThread:withObject:withObject:waitUntilDone:
 Performs the specified selector on the specified thread with the specified objects.
 
(void) - performSelector:onThread:withObject:withObject:withObject:waitUntilDone:
 Performs the specified selector on the specified thread with the specified objects.
 
(void) - performSelector:onThread:withObject:withObject:withObject:withObject:waitUntilDone:
 Performs the specified selector on the specified thread with the specified objects.
 
(void) - performSelectorOnMainThread:waitUntilDone:
 Performs the specified selector on the main thread.
 
(void) - performSelectorOnMainThread:withObject:waitUntilDone:
 Performs the specified selector on the main thread with the specified object.
 
(void) - performSelectorOnMainThread:withObject:withObject:waitUntilDone:
 Performs the specified selector on the main thread with the specified objects.
 
(void) - performSelectorOnMainThread:withObject:withObject:withObject:waitUntilDone:
 Performs the specified selector on the main thread with the specified objects.
 
(void) - performSelectorOnMainThread:withObject:withObject:withObject:withObject:waitUntilDone:
 Performs the specified selector on the main thread with the specified objects.
 
(void) - performSelector:onThread:afterDelay:
 Performs the specified selector on the specified thread after the specified delay.
 
(void) - performSelector:onThread:withObject:afterDelay:
 Performs the specified selector on the specified thread with the specified object after the specified delay.
 
(void) - performSelector:onThread:withObject:withObject:afterDelay:
 Performs the specified selector on the specified thread with the specified objects after the specified delay.
 
(void) - performSelector:onThread:withObject:withObject:withObject:afterDelay:
 Performs the specified selector on the specified thread with the specified objects after the specified delay.
 
(void) - performSelector:onThread:withObject:withObject:withObject:withObject:afterDelay:
 Performs the specified selector on the specified thread with the specified objects after the specified delay.
 
(nullable id) - forwardingTargetForSelector:
 This method is called when resolveClassMethod: or resolveInstanceMethod: returned false. It should return a target to which the message should be forwarded.
 
(void) - doesNotRecognizeSelector:
 Handles messages which are not understood by the receiver.
 
- Instance Methods inherited from <OFObject>
(unsigned long) - hash
 Returns a hash for the object.
 
(unsigned int) - retainCount
 Returns the retain count.
 
(bool) - isProxy
 Returns whether the object is a proxy object.
 
(bool) - isKindOfClass:
 Returns a boolean whether the object is of the specified kind.
 
(bool) - isMemberOfClass:
 Returns a boolean whether the object is a member of the specified class.
 
(bool) - respondsToSelector:
 Returns a boolean whether the object responds to the specified selector.
 
(nullable IMP- methodForSelector:
 Returns the implementation for the specified selector.
 
(nullable id) - performSelector:
 Performs the specified selector.
 
(nullable id) - performSelector:withObject:
 Performs the specified selector with the specified object.
 
(nullable id) - performSelector:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(nullable id) - performSelector:withObject:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(nullable id) - performSelector:withObject:withObject:withObject:withObject:
 Performs the specified selector with the specified objects.
 
(bool) - isEqual:
 Checks two objects for equality.
 
(instancetype) - retain
 Increases the retain count.
 
(void) - release
 Decreases the retain count.
 
(instancetype) - autorelease
 Adds the object to the topmost autorelease pool of the thread's autorelease pool stack.
 
(instancetype) - self
 Returns the receiver.
 
(bool) - allowsWeakReference
 Returns whether the object allows a weak reference.
 
(bool) - retainWeakReference
 Retain a weak reference to this object.
 

Class Methods

(OFFileManager *) + defaultManager
 Returns the default file manager.
 
- Class Methods inherited from OFObject
(void) + load
 A method which is called once when the class is loaded into the runtime.
 
(void) + unload
 A method which is called when the class is unloaded from the runtime.
 
(void) + initialize
 A method which is called the moment before the first call to the class is being made.
 
(instancetype) + alloc
 Allocates memory for an instance of the class and sets up the memory pool for the object.
 
(Class) + class
 Returns the class.
 
(OFString *) + className
 Returns the name of the class as a string.
 
(bool) + isSubclassOfClass:
 Returns a boolean whether the class is a subclass of the specified class.
 
(nullable Class) + superclass
 Returns the superclass of the class.
 
(bool) + instancesRespondToSelector:
 Checks whether instances of the class respond to a given selector.
 
(bool) + conformsToProtocol:
 Checks whether the class conforms to a given protocol.
 
(nullable IMP+ instanceMethodForSelector:
 Returns the implementation of the instance method for the specified selector.
 
(nullable OFMethodSignature *) + instanceMethodSignatureForSelector:
 Returns the method signature of the instance method for the specified selector.
 
(OFString *) + description
 Returns a description for the class, which is usually the class name.
 
(nullable IMP+ replaceClassMethod:withMethodFromClass:
 Replaces a class method with a class method from another class.
 
(nullable IMP+ replaceInstanceMethod:withMethodFromClass:
 Replaces an instance method with an instance method from another class.
 
(void) + inheritMethodsFromClass:
 Adds all methods from the specified class to the class that is the receiver.
 
(bool) + resolveClassMethod:
 Try to resolve the specified class method.
 
(bool) + resolveInstanceMethod:
 Try to resolve the specified instance method.
 
(id) + copy
 Returns the class.
 

Properties

OFStringcurrentDirectoryPath
 The path of the current working directory.
 
OFIRIcurrentDirectoryIRI
 The IRI of the current working directory.
 
- Properties inherited from OFObject
OFStringclassName
 The name of the object's class.
 
OFStringdescription
 A description for the object.
 

Detailed Description

A class which provides management for files, e.g. reading contents of directories, deleting files, renaming files, etc.

Method Documentation

◆ attributesOfItemAtIRI:

- (OFFileAttributes) attributesOfItemAtIRI: (OFIRI *) IRI

Returns the attributes for the item at the specified IRI.

Parameters
IRIThe IRI to return the attributes for
Returns
A dictionary of attributes for the specified IRI, with the keys of type OFFileAttributeKey
Exceptions
OFGetItemAttributesFailedExceptionFailed to get the attributes of the item
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ attributesOfItemAtPath:

- (OFFileAttributes) attributesOfItemAtPath: (OFString *) path

Returns the attributes for the item at the specified path.

Parameters
pathThe path to return the attributes for
Returns
A dictionary of attributes for the specified path, with the keys of type OFFileAttributeKey
Exceptions
OFGetItemAttributesFailedExceptionFailed to get the attributes of the item

◆ changeCurrentDirectoryIRI:

- (void) changeCurrentDirectoryIRI: (OFIRI *) IRI

Changes the current working directory.

Parameters
IRIThe new directory to change to
Exceptions
OFChangeCurrentDirectoryFailedExceptionChanging the current working directory failed

◆ changeCurrentDirectoryPath:

- (void) changeCurrentDirectoryPath: (OFString *) path

Changes the current working directory.

Parameters
pathThe new directory to change to
Exceptions
OFChangeCurrentDirectoryFailedExceptionChanging the current working directory failed

◆ contentsOfDirectoryAtIRI:

- (OFArray *) contentsOfDirectoryAtIRI: (OFIRI *) IRI

Returns an array with the IRIs of the items in the specified directory.

Note
. and .. are not part of the returned array.
Parameters
IRIThe IRI to the directory whose items should be returned
Returns
An array with the IRIs of the items in the specified directory
Exceptions
OFOpenItemFailedExceptionOpening the directory failed
OFReadFailedExceptionReading from the directory failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ contentsOfDirectoryAtPath:

- (OFArray *) contentsOfDirectoryAtPath: (OFString *) path

Returns an array with the items in the specified directory.

Note
. and .. are not part of the returned array.
Parameters
pathThe path to the directory whose items should be returned
Returns
An array of OFString with the items in the specified directory
Exceptions
OFOpenItemFailedExceptionOpening the directory failed
OFReadFailedExceptionReading from the directory failed

◆ copyItemAtIRI:toIRI:

- (void) copyItemAtIRI: (OFIRI *) source
toIRI: (OFIRI *) destination 

Copies a file, directory or symbolic link (if supported by the OS).

The destination IRI must have a full path, which means it must include the name of the item.

If an item already exists, the copy operation fails. This is also the case if a directory is copied and an item already exists in the destination directory.

Parameters
sourceThe file, directory or symbolic link to copy
destinationThe destination IRI
Exceptions
OFCopyItemFailedExceptionCopying failed
OFCreateDirectoryFailedExceptionCreating a destination directory failed
OFUnsupportedProtocolExceptionNo handler is registered for either of the IRI's scheme

◆ copyItemAtPath:toPath:

- (void) copyItemAtPath: (OFString *) source
toPath: (OFString *) destination 

Copies a file, directory or symbolic link (if supported by the OS).

The destination path must be a full path, which means it must include the name of the item.

If an item already exists, the copy operation fails. This is also the case if a directory is copied and an item already exists in the destination directory.

Parameters
sourceThe file, directory or symbolic link to copy
destinationThe destination path
Exceptions
OFCopyItemFailedExceptionCopying failed
OFCreateDirectoryFailedExceptionCreating a destination directory failed

◆ createDirectoryAtIRI:

- (void) createDirectoryAtIRI: (OFIRI *) IRI

Creates a directory at the specified IRI.

Parameters
IRIThe IRI of the directory to create
Exceptions
OFCreateDirectoryFailedExceptionCreating the directory failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ createDirectoryAtIRI:createParents:

- (void) createDirectoryAtIRI: (OFIRI *) IRI
createParents: (bool) createParents 

Creates a directory at the specified IRI.

Parameters
IRIThe IRI of the directory to create
createParentsWhether to create the parents of the directory
Exceptions
OFCreateDirectoryFailedExceptionCreating the directory or one of its parents failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ createDirectoryAtPath:

- (void) createDirectoryAtPath: (OFString *) path

Creates a directory at the specified path.

Parameters
pathThe path of the directory to create
Exceptions
OFCreateDirectoryFailedExceptionCreating the directory failed

◆ createDirectoryAtPath:createParents:

- (void) createDirectoryAtPath: (OFString *) path
createParents: (bool) createParents 

Creates a directory at the specified path.

Parameters
pathThe path of the directory to create
createParentsWhether to create the parents of the directory
Exceptions
OFCreateDirectoryFailedExceptionCreating the directory or one of its parents failed

◆ createSymbolicLinkAtIRI:withDestinationPath:

- (void) createSymbolicLinkAtIRI: (OFIRI *) IRI
withDestinationPath: (OFString *) target 

Creates a symbolic link for an item.

The destination IRI must have a full path, which means it must include the name of the item.

This method is not available for all IRIs.

Note
For file IRIs on Windows, this requires at least Windows Vista and administrator privileges!
Parameters
IRIThe IRI to the item which should symbolically link to the target
targetThe target of the symbolic link
Exceptions
OFOFCreateSymbolicLinkFailedExceptionCreating a symbolic link failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ createSymbolicLinkAtPath:withDestinationPath:

- (void) createSymbolicLinkAtPath: (OFString *) path
withDestinationPath: (OFString *) target 

Creates a symbolic link for an item.

The destination path must be a full path, which means it must include the name of the item.

This method is not available on some systems.

Note
On Windows, this requires at least Windows Vista and administrator privileges!
Parameters
pathThe path to the item which should symbolically link to the target
targetThe target of the symbolic link
Exceptions
OFCreateSymbolicLinkFailedExceptionCreating the symbolic link failed
OFNotImplementedExceptionSymbolic links are not implemented for the specified IRI

◆ directoryExistsAtIRI:

- (bool) directoryExistsAtIRI: (OFIRI *) IRI

Checks whether a directory exists at the specified IRI.

Parameters
IRIThe IRI to check
Returns
A boolean whether there is a directory at the specified IRI
Exceptions
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ directoryExistsAtPath:

- (bool) directoryExistsAtPath: (OFString *) path

Checks whether a directory exists at the specified path.

Parameters
pathThe path to check
Returns
A boolean whether there is a directory at the specified path

◆ extendedAttributeDataForName:ofItemAtIRI:

- (OFData *) extendedAttributeDataForName: (OFString *) name
ofItemAtIRI: (OFIRI *) IRI 

Returns the extended attribute data for the specified name of the item at the specified IRI.

This method is not available for all IRIs.

Parameters
nameThe name of the extended attribute
IRIThe IRI of the item to return the extended attribute from
Returns
The extended attribute data for the specified name of the item at the specified IRI
Exceptions
OFGetItemAttributesFailedExceptionGetting the extended attribute failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme
OFNotImplementedExceptionGetting extended attributes is not implemented for the specified item

◆ extendedAttributeDataForName:ofItemAtPath:

- (OFData *) extendedAttributeDataForName: (OFString *) name
ofItemAtPath: (OFString *) path 

Returns the extended attribute data for the specified name of the item at the specified path.

This method is not available on some systems.

Parameters
nameThe name of the extended attribute
pathThe path of the item to return the extended attribute from
Returns
The extended attribute data for the specified name of the item at the specified IRI
Exceptions
OFGetItemAttributesFailedExceptionGetting the extended attribute failed
OFNotImplementedExceptionGetting extended attributes is not implemented for the specified item

◆ fileExistsAtIRI:

- (bool) fileExistsAtIRI: (OFIRI *) IRI

Checks whether a file exists at the specified IRI.

Parameters
IRIThe IRI to check
Returns
A boolean whether there is a file at the specified IRI
Exceptions
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ fileExistsAtPath:

- (bool) fileExistsAtPath: (OFString *) path

Checks whether a file exists at the specified path.

Parameters
pathThe path to check
Returns
A boolean whether there is a file at the specified path

◆ getExtendedAttributeData:andType:forName:ofItemAtIRI:

- (void) getExtendedAttributeData: (OFData * *) data
andType: (id *) type
forName: (OFString *) name
ofItemAtIRI: (OFIRI *) IRI 

Gets the extended attribute data and type for the specified name of the item at the specified IRI.

This method is not available for all IRIs.

Parameters
dataA pointer to OFData * that gets set to the data of the extended attribute
typeA pointer to id that gets set to the type of the extended attribute, if not NULL. Gets set to nil if the extended attribute has no type. The type of the type depends on the IRI handler.
nameThe name of the extended attribute
IRIThe IRI of the item to return the extended attribute from
Exceptions
OFGetItemAttributesFailedExceptionGetting the extended attribute failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme
OFNotImplementedExceptionGetting extended attributes is not implemented for the specified item

◆ getExtendedAttributeData:andType:forName:ofItemAtPath:

- (void) getExtendedAttributeData: (OFData * *) data
andType: (id *) type
forName: (OFString *) name
ofItemAtPath: (OFString *) path 

Gets the extended attribute data and type for the specified name of the item at the specified path.

This method is not available on some systems.

Parameters
dataA pointer to OFData * that gets set to the data of the extended attribute
typeA pointer to id that gets set to the type of the extended attribute, if not NULL. Gets set to nil if the extended attribute has no type. The type of the type depends on the system.
nameThe name of the extended attribute
pathThe path of the item to return the extended attribute from
Exceptions
OFGetItemAttributesFailedExceptionGetting the extended attribute failed
OFNotImplementedExceptionGetting extended attributes is not implemented for the specified item

◆ linkItemAtIRI:toIRI:

- (void) linkItemAtIRI: (OFIRI *) source
toIRI: (OFIRI *) destination 

Creates a hard link for the specified item.

The destination IRI must have a full path, which means it must include the name of the item.

This method is not available for all IRIs.

Parameters
sourceThe IRI to the item for which a link should be created
destinationThe IRI to the item which should link to the source
Exceptions
OFLinkItemFailedExceptionLinking the item failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme
OFNotImplementedExceptionHardlinks are not implemented for the specified IRI

◆ linkItemAtPath:toPath:

- (void) linkItemAtPath: (OFString *) source
toPath: (OFString *) destination 

Creates a hard link for the specified item.

The destination path must be a full path, which means it must include the name of the item.

This method is not available on some systems.

Parameters
sourceThe path to the item for which a link should be created
destinationThe path to the item which should link to the source
Exceptions
OFLinkItemFailedExceptionLinking the item failed
OFNotImplementedExceptionHardlinks are not implemented for the specified IRI

◆ moveItemAtIRI:toIRI:

- (void) moveItemAtIRI: (OFIRI *) source
toIRI: (OFIRI *) destination 

Moves an item.

The destination IRI must have a full path, which means it must include the name of the item.

If the destination is on a different logical device or uses a different scheme, the source will be copied to the destination using copyItemAtIRI:toIRI: and the source removed using removeItemAtIRI:.

Parameters
sourceThe item to rename
destinationThe new name for the item
Exceptions
OFMoveItemFailedExceptionMoving failed
OFCopyItemFailedExceptionCopying (to move between different devices) failed
OFRemoveItemFailedExceptionRemoving the source after copying to the destination (to move between different devices) failed
OFCreateDirectoryFailedExceptionCreating a destination directory failed
OFUnsupportedProtocolExceptionNo handler is registered for either of the IRI's scheme

◆ moveItemAtPath:toPath:

- (void) moveItemAtPath: (OFString *) source
toPath: (OFString *) destination 

Moves an item.

The destination path must be a full path, which means it must include the name of the item.

If the destination is on a different logical device, the source will be copied to the destination using copyItemAtPath:toPath: and the source removed using removeItemAtPath:.

Parameters
sourceThe item to rename
destinationThe new name for the item
Exceptions
OFMoveItemFailedExceptionMoving failed
OFCopyItemFailedExceptionCopying (to move between different devices) failed
OFRemoveItemFailedExceptionRemoving the source after copying to the destination (to move between different devices) failed
OFCreateDirectoryFailedExceptionCreating a destination directory failed

◆ removeExtendedAttributeForName:ofItemAtIRI:

- (void) removeExtendedAttributeForName: (OFString *) name
ofItemAtIRI: (OFIRI *) IRI 

Removes the extended attribute for the specified name of the item at the specified IRI.

This method is not available for all IRIs.

Parameters
nameThe name of the extended attribute to remove
IRIThe IRI of the item to remove the extended attribute from
Exceptions
OFSetItemAttributesFailedExceptionRemoving the extended attribute failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme
OFNotImplementedExceptionRemoving extended attributes is not implemented for the specified item

◆ removeExtendedAttributeForName:ofItemAtPath:

- (void) removeExtendedAttributeForName: (OFString *) name
ofItemAtPath: (OFString *) path 

Removes the extended attribute for the specified name of the item at the specified path.

This method is not available on some systems.

Parameters
nameThe name of the extended attribute to remove
pathThe path of the item to remove the extended attribute from
Exceptions
OFSetItemAttributesFailedExceptionRemoving the extended attribute failed
OFNotImplementedExceptionRemoving extended attributes is not implemented for the specified item

◆ removeItemAtIRI:

- (void) removeItemAtIRI: (OFIRI *) IRI

Removes the item at the specified IRI.

If the item at the specified IRI is a directory, it is removed recursively.

Parameters
IRIThe IRI to the item which should be removed
Exceptions
OFRemoveItemFailedExceptionRemoving the item failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme

◆ removeItemAtPath:

- (void) removeItemAtPath: (OFString *) path

Removes the item at the specified path.

If the item at the specified path is a directory, it is removed recursively.

Parameters
pathThe path to the item which should be removed
Exceptions
OFRemoveItemFailedExceptionRemoving the item failed

◆ setAttributes:ofItemAtIRI:

- (void) setAttributes: (OFFileAttributes) attributes
ofItemAtIRI: (OFIRI *) IRI 

Sets the attributes for the item at the specified IRI.

All attributes not part of the dictionary are left unchanged.

Parameters
attributesThe attributes to set for the specified IRI
IRIThe IRI of the item to set the attributes for
Exceptions
OFSetItemAttributesFailedExceptionFailed to set the attributes of the item
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme
OFNotImplementedExceptionSetting one or more of the specified attributes is not implemented for the specified item

◆ setAttributes:ofItemAtPath:

- (void) setAttributes: (OFFileAttributes) attributes
ofItemAtPath: (OFString *) path 

Sets the attributes for the item at the specified path.

All attributes not part of the dictionary are left unchanged.

Parameters
attributesThe attributes to set for the specified path
pathThe path of the item to set the attributes for
Exceptions
OFSetItemAttributesFailedExceptionFailed to set the attributes of the item
OFNotImplementedExceptionSetting one or more of the specified attributes is not implemented for the specified item

◆ setExtendedAttributeData:andType:forName:ofItemAtIRI:

- (void) setExtendedAttributeData: (OFData *) data
andType: (nullable id) type
forName: (OFString *) name
ofItemAtIRI: (OFIRI *) IRI 

Sets the extended attribute data for the specified name of the item at the specified IRI.

This method is not available for all IRIs.

Parameters
dataThe data for the extended attribute
typeThe type for the extended attribute. nil does not mean to keep the existing type, but to set it to no type. The type of the type depends on the IRI handler.
nameThe name of the extended attribute
IRIThe IRI of the item to set the extended attribute on
Exceptions
OFSetItemAttributesFailedExceptionSetting the extended attribute failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme
OFNotImplementedExceptionSetting extended attributes is not implemented for the specified item or a type was specified and typed extended attributes are not supported

◆ setExtendedAttributeData:andType:forName:ofItemAtPath:

- (void) setExtendedAttributeData: (OFData *) data
andType: (nullable id) type
forName: (OFString *) name
ofItemAtPath: (OFString *) path 

Sets the extended attribute data for the specified name of the item at the specified path.

This method is not available on some systems.

Parameters
dataThe data for the extended attribute
typeThe type for the extended attribute. nil does not mean to keep the existing type, but to set it to no type. The type of the type depends on the system.
nameThe name of the extended attribute
pathThe path of the item to set the extended attribute on
Exceptions
OFSetItemAttributesFailedExceptionSetting the extended attribute failed
OFNotImplementedExceptionSetting extended attributes is not implemented for the specified item or a type was specified and typed extended attributes are not supported

◆ setExtendedAttributeData:forName:ofItemAtIRI:

- (void) setExtendedAttributeData: (OFData *) data
forName: (OFString *) name
ofItemAtIRI: (OFIRI *) IRI 

Sets the extended attribute data for the specified name of the item at the specified IRI.

This method is not available for all IRIs.

Parameters
dataThe data for the extended attribute
nameThe name of the extended attribute
IRIThe IRI of the item to set the extended attribute on
Exceptions
OFSetItemAttributesFailedExceptionSetting the extended attribute failed
OFUnsupportedProtocolExceptionNo handler is registered for the IRI's scheme
OFNotImplementedExceptionSetting extended attributes is not implemented for the specified item

◆ setExtendedAttributeData:forName:ofItemAtPath:

- (void) setExtendedAttributeData: (OFData *) data
forName: (OFString *) name
ofItemAtPath: (OFString *) path 

Sets the extended attribute data for the specified name of the item at the specified path.

This method is not available on some systems.

Parameters
dataThe data for the extended attribute
nameThe name of the extended attribute
pathThe path of the item to set the extended attribute on
Exceptions
OFSetItemAttributesFailedExceptionSetting the extended attribute failed
OFNotImplementedExceptionSetting extended attributes is not implemented for the specified item

◆ subpathsOfDirectoryAtPath:

- (OFArray *) subpathsOfDirectoryAtPath: (OFString *) path

Returns an array with all subpaths of the specified directory.

Note
. and .. (of the directory itself or any subdirectory) are not part of the returned array.
Parameters
pathThe path to the directory whose subpaths should be returned
Returns
An array of OFString with the subpaths of the specified directory

Property Documentation

◆ currentDirectoryIRI

- (OFIRI *) currentDirectoryIRI
readnonatomicassign

The IRI of the current working directory.

Exceptions
OFGetCurrentDirectoryFailedExceptionCouldn't get current directory

◆ currentDirectoryPath

- (OFString *) currentDirectoryPath
readnonatomicassign

The path of the current working directory.

Exceptions
OFGetCurrentDirectoryFailedExceptionCouldn't get current directory

The documentation for this class was generated from the following files: