17 #import "OFDictionary.h" 19 OF_ASSUME_NONNULL_BEGIN
24 # if (defined(OF_HAVE_CHMOD) && !defined(OF_AMIGAOS)) || defined(DOXYGEN) 25 # define OF_FILE_MANAGER_SUPPORTS_PERMISSIONS 27 # if (defined(OF_HAVE_CHOWN) && !defined(OF_AMIGAOS)) || defined(DOXYGEN) 28 # define OF_FILE_MANAGER_SUPPORTS_OWNER 30 # if (defined(OF_HAVE_LINK) && !defined(OF_AMIGAOS)) || defined(OF_WINDOWS) || \ 32 # define OF_FILE_MANAGER_SUPPORTS_LINKS 34 # if (defined(OF_HAVE_SYMLINK) && !defined(OF_AMIGAOS)) || \ 35 defined(OF_WINDOWS) || defined(DOXYGEN) 36 # define OF_FILE_MANAGER_SUPPORTS_SYMLINKS 38 # if defined(OF_LINUX) || defined(OF_MACOS) || defined(DOXYGEN) 39 # define OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 43 @class OFArray OF_GENERIC(ObjectType);
266 #ifndef OF_FILE_MANAGER_M 267 OF_SUBCLASSING_RESTRICTED
270 #ifdef OF_HAVE_CLASS_PROPERTIES 363 - (bool)fileExistsAtPath: (
OFString *)path;
374 - (bool)fileExistsAtIRI: (
OFIRI *)IRI;
383 - (bool)directoryExistsAtPath: (
OFString *)path;
394 - (bool)directoryExistsAtIRI: (
OFIRI *)IRI;
403 - (void)createDirectoryAtPath: (
OFString *)path;
413 - (void)createDirectoryAtPath: (
OFString *)path
414 createParents: (
bool)createParents;
425 - (void)createDirectoryAtIRI: (
OFIRI *)IRI;
437 - (void)createDirectoryAtIRI: (
OFIRI *)IRI createParents: (
bool)createParents;
487 - (void)changeCurrentDirectoryPath: (
OFString *)path;
496 - (void)changeCurrentDirectoryIRI: (
OFIRI *)IRI;
535 - (void)copyItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
585 - (void)moveItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
596 - (void)removeItemAtPath: (
OFString *)path;
609 - (void)removeItemAtIRI: (
OFIRI *)IRI;
611 #ifdef OF_FILE_MANAGER_SUPPORTS_LINKS 645 - (void)linkItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
647 #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS 665 - (void)createSymbolicLinkAtPath: (
OFString *)path
666 withDestinationPath: (
OFString *)target;
686 - (void)createSymbolicLinkAtIRI: (
OFIRI *)IRI
687 withDestinationPath: (
OFString *)target;
689 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 723 ofItemAtIRI: (
OFIRI *)IRI;
725 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 740 - (void)setExtendedAttributeData: (
OFData *)data
761 - (void)setExtendedAttributeData: (
OFData *)data
763 ofItemAtIRI: (
OFIRI *)IRI;
765 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 779 - (void)removeExtendedAttributeForName: (
OFString *)name
798 - (void)removeExtendedAttributeForName: (
OFString *)name
799 ofItemAtIRI: (
OFIRI *)IRI;
802 @interface OFDictionary (FileAttributes)
808 @property (readonly, nonatomic) unsigned long long fileSize;
822 @property (readonly, nonatomic)
unsigned long filePOSIXPermissions;
829 @property (readonly, nonatomic)
unsigned long fileOwnerAccountID;
836 @property (readonly, nonatomic)
unsigned long fileGroupOwnerAccountID;
843 @property (readonly, nonatomic)
OFString *fileOwnerAccountName;
850 @property (readonly, nonatomic)
OFString *fileGroupOwnerAccountName;
857 @property (readonly, nonatomic)
OFDate *fileLastAccessDate;
864 @property (readonly, nonatomic)
OFDate *fileModificationDate;
871 @property (readonly, nonatomic)
OFDate *fileStatusChangeDate;
878 @property (readonly, nonatomic)
OFDate *fileCreationDate;
885 @property (readonly, nonatomic)
OFString *fileSymbolicLinkDestination;
892 @property (readonly, nonatomic)
896 OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition: OFArray.h:103
const OFFileAttributeKey OFFileModificationDate
The last modification date of the file as an OFDate.
const OFFileAttributeType OFFileTypeSocket
A socket.
OFConstantString * OFFileAttributeKey
A key for a file attribute in the file attributes dictionary.
Definition: OFFileManager.h:47
const OFFileAttributeKey OFFileLastAccessDate
The last access date of the file as an OFDate.
const OFFileAttributeType OFFileTypeSymbolicLink
A symbolic link.
const OFFileAttributeType OFFileTypeFIFO
A FIFO.
A class for storing, accessing and comparing dates.
Definition: OFDate.h:29
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:37
A class which provides management for files, e.g. reading contents of directories, deleting files, renaming files, etc.
Definition: OFFileManager.h:269
The root class for all other classes inside ObjFW.
Definition: OFObject.h:686
OFIRI * currentDirectoryIRI
The IRI of the current working directory.
Definition: OFFileManager.h:287
const OFFileAttributeKey OFFileExtendedAttributesNames
The names of the extended attributes as an OFArray of OFString.
const OFFileAttributeKey OFFileOwnerAccountID
The account ID of the owner of the file as an OFNumber.
const OFFileAttributeKey OFFileSymbolicLinkDestination
The destination of a symbolic link as an OFString.
const OFFileAttributeKey OFFileSize
The size of the file as an OFNumber.
OFDictionary * OFFileAttributes
A dictionary mapping keys of type OFFileAttributeKey to their attribute values.
Definition: OFFileManager.h:94
const OFFileAttributeKey OFFileGroupOwnerAccountID
The account ID of the group owner of the file as an OFNumber.
A class for handling strings.
Definition: OFString.h:134
const OFFileAttributeKey OFFileStatusChangeDate
The last status change date of the file as an OFDate.
const OFFileAttributeKey OFFileType
The type of the file.
An abstract class for storing objects in a dictionary.
Definition: OFDictionary.h:78
const OFFileAttributeKey OFFileOwnerAccountName
The account name of the owner of the file as an OFString.
OFFileManager * defaultManager()
Returns the default file manager.
Definition: OFFileManager.m:132
An abstract class for storing and changing objects in a dictionary.
Definition: OFMutableDictionary.h:42
const OFFileAttributeType OFFileTypeDirectory
A directory.
const OFFileAttributeType OFFileTypeBlockSpecial
A block special file.
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition: OFIRI.h:35
OFArray * fileExtendedAttributesNames
The OFFileExtendedAttributesNames key from the dictionary.
Definition: OFFileManager.h:893
const OFFileAttributeType OFFileTypeCharacterSpecial
A character special file.
const OFFileAttributeKey OFFilePOSIXPermissions
The POSIX permissions of the file as an OFNumber.
A class for storing arbitrary data in an array.
Definition: OFData.h:41
const OFFileAttributeKey OFFileCreationDate
The creation date of the file as an OFDate.
const OFFileAttributeType OFFileTypeRegular
A regular file.
const OFFileAttributeType OFFileTypeUnknown
An unknown file type.
OFString * currentDirectoryPath
The path of the current working directory.
Definition: OFFileManager.h:280
const OFFileAttributeKey OFFileGroupOwnerAccountName
The account name of the group owner of the file as an OFString.
OFMutableDictionary * OFMutableFileAttributes
A mutable dictionary mapping keys of type OFFileAttributeKey to their attribute values.
Definition: OFFileManager.h:101
OFConstantString * OFFileAttributeType
The type of a file.
Definition: OFFileManager.h:88