21 #import "OFDictionary.h" 23 OF_ASSUME_NONNULL_BEGIN
28 # if (defined(OF_HAVE_CHMOD) && !defined(OF_AMIGAOS)) || defined(DOXYGEN) 29 # define OF_FILE_MANAGER_SUPPORTS_PERMISSIONS 31 # if (defined(OF_HAVE_CHOWN) && !defined(OF_AMIGAOS)) || defined(DOXYGEN) 32 # define OF_FILE_MANAGER_SUPPORTS_OWNER 34 # if (defined(OF_HAVE_LINK) && !defined(OF_AMIGAOS) && !defined(OF_HAIKU)) || \ 35 defined(OF_WINDOWS) || defined(DOXYGEN) 36 # define OF_FILE_MANAGER_SUPPORTS_LINKS 38 # if (defined(OF_HAVE_SYMLINK) && !defined(OF_AMIGAOS)) || \ 39 defined(OF_WINDOWS) || defined(DOXYGEN) 40 # define OF_FILE_MANAGER_SUPPORTS_SYMLINKS 42 # if defined(OF_LINUX) || defined(OF_MACOS) || defined(OF_FREEBSD) || \ 43 defined(OF_NETBSD) || defined(OF_HAIKU) || defined(DOXYGEN) 44 # define OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 48 @class OFArray OF_GENERIC(ObjectType);
271 #ifndef OF_FILE_MANAGER_M 272 OF_SUBCLASSING_RESTRICTED
275 #ifdef OF_HAVE_CLASS_PROPERTIES 368 - (bool)fileExistsAtPath: (
OFString *)path;
379 - (bool)fileExistsAtIRI: (
OFIRI *)IRI;
388 - (bool)directoryExistsAtPath: (
OFString *)path;
399 - (bool)directoryExistsAtIRI: (
OFIRI *)IRI;
408 - (void)createDirectoryAtPath: (
OFString *)path;
418 - (void)createDirectoryAtPath: (
OFString *)path
419 createParents: (
bool)createParents;
430 - (void)createDirectoryAtIRI: (
OFIRI *)IRI;
442 - (void)createDirectoryAtIRI: (
OFIRI *)IRI createParents: (
bool)createParents;
492 - (void)changeCurrentDirectoryPath: (
OFString *)path;
501 - (void)changeCurrentDirectoryIRI: (
OFIRI *)IRI;
540 - (void)copyItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
590 - (void)moveItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
601 - (void)removeItemAtPath: (
OFString *)path;
614 - (void)removeItemAtIRI: (
OFIRI *)IRI;
616 #ifdef OF_FILE_MANAGER_SUPPORTS_LINKS 650 - (void)linkItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
652 #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS 670 - (void)createSymbolicLinkAtPath: (
OFString *)path
671 withDestinationPath: (
OFString *)target;
691 - (void)createSymbolicLinkAtIRI: (
OFIRI *)IRI
692 withDestinationPath: (
OFString *)target;
694 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 732 - (void)getExtendedAttributeData: (
OFData *_Nonnull *_Nonnull)data
733 andType: (
id _Nullable *_Nullable)type
756 ofItemAtIRI: (
OFIRI *)IRI;
779 - (void)getExtendedAttributeData: (
OFData *_Nonnull *_Nonnull)data
780 andType: (
id _Nullable *_Nullable)type
782 ofItemAtIRI: (
OFIRI *)IRI;
784 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 799 - (void)setExtendedAttributeData: (
OFData *)data
822 - (void)setExtendedAttributeData: (
OFData *)data
823 andType: (nullable
id)type
844 - (void)setExtendedAttributeData: (
OFData *)data
846 ofItemAtIRI: (
OFIRI *)IRI;
869 - (void)setExtendedAttributeData: (
OFData *)data
870 andType: (nullable
id)type
872 ofItemAtIRI: (
OFIRI *)IRI;
874 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 888 - (void)removeExtendedAttributeForName: (
OFString *)name
907 - (void)removeExtendedAttributeForName: (
OFString *)name
908 ofItemAtIRI: (
OFIRI *)IRI;
911 @interface OFDictionary (FileAttributes)
917 @property (readonly, nonatomic) unsigned long long fileSize;
931 @property (readonly, nonatomic)
unsigned long filePOSIXPermissions;
938 @property (readonly, nonatomic)
unsigned long fileOwnerAccountID;
945 @property (readonly, nonatomic)
unsigned long fileGroupOwnerAccountID;
952 @property (readonly, nonatomic)
OFString *fileOwnerAccountName;
959 @property (readonly, nonatomic)
OFString *fileGroupOwnerAccountName;
966 @property (readonly, nonatomic)
OFDate *fileLastAccessDate;
973 @property (readonly, nonatomic)
OFDate *fileModificationDate;
980 @property (readonly, nonatomic)
OFDate *fileStatusChangeDate;
987 @property (readonly, nonatomic)
OFDate *fileCreationDate;
994 @property (readonly, nonatomic)
OFString *fileSymbolicLinkDestination;
1001 @property (readonly, nonatomic)
1005 OF_ASSUME_NONNULL_END
An abstract class for storing objects in an array.
Definition: OFArray.h:107
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:52
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:33
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:41
A class which provides management for files, e.g. reading contents of directories, deleting files, renaming files, etc.
Definition: OFFileManager.h:274
The root class for all other classes inside ObjFW.
Definition: OFObject.h:690
OFIRI * currentDirectoryIRI
The IRI of the current working directory.
Definition: OFFileManager.h:292
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:99
const OFFileAttributeKey OFFileGroupOwnerAccountID
The account ID of the group owner of the file as an OFNumber.
A class for handling strings.
Definition: OFString.h:138
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:82
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:136
An abstract class for storing and changing objects in a dictionary.
Definition: OFMutableDictionary.h:46
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:39
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:45
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:285
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:106
OFConstantString * OFFileAttributeType
The type of a file.
Definition: OFFileManager.h:93