21 #import "OFDictionary.h" 23 OF_ASSUME_NONNULL_BEGIN
28 # if (defined(OF_HAVE_CHMOD) && !defined(OF_NINTENDO_DS)) || defined(DOXYGEN) 29 # define OF_FILE_MANAGER_SUPPORTS_PERMISSIONS 31 # if defined(OF_HAVE_CHOWN) || defined(DOXYGEN) 32 # define OF_FILE_MANAGER_SUPPORTS_OWNER 34 # if (defined(OF_HAVE_LINK) && !defined(OF_AMIGAOS) && \ 35 !defined(OF_NINTENDO_DS)) || defined(OF_WINDOWS) || defined(DOXYGEN) 36 # define OF_FILE_MANAGER_SUPPORTS_LINKS 38 # if (defined(OF_HAVE_SYMLINK) && !defined(OF_AMIGAOS) && \ 39 !defined(OF_NINTENDO_DS)) || 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(OF_SOLARIS) || \ 45 # define OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 49 @class OFArray OF_GENERIC(ObjectType);
351 #ifndef OF_FILE_MANAGER_M 352 OF_SUBCLASSING_RESTRICTED
355 #ifdef OF_HAVE_CLASS_PROPERTIES 448 - (bool)fileExistsAtPath: (
OFString *)path;
459 - (bool)fileExistsAtIRI: (
OFIRI *)IRI;
468 - (bool)directoryExistsAtPath: (
OFString *)path;
479 - (bool)directoryExistsAtIRI: (
OFIRI *)IRI;
488 - (void)createDirectoryAtPath: (
OFString *)path;
498 - (void)createDirectoryAtPath: (
OFString *)path
499 createParents: (
bool)createParents;
510 - (void)createDirectoryAtIRI: (
OFIRI *)IRI;
522 - (void)createDirectoryAtIRI: (
OFIRI *)IRI createParents: (
bool)createParents;
572 - (void)changeCurrentDirectoryPath: (
OFString *)path;
581 - (void)changeCurrentDirectoryIRI: (
OFIRI *)IRI;
620 - (void)copyItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
670 - (void)moveItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
681 - (void)removeItemAtPath: (
OFString *)path;
694 - (void)removeItemAtIRI: (
OFIRI *)IRI;
696 #ifdef OF_FILE_MANAGER_SUPPORTS_LINKS 730 - (void)linkItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
732 #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS 750 - (void)createSymbolicLinkAtPath: (
OFString *)path
751 withDestinationPath: (
OFString *)target;
771 - (void)createSymbolicLinkAtIRI: (
OFIRI *)IRI
772 withDestinationPath: (
OFString *)target;
774 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 812 - (void)getExtendedAttributeData: (
OFData *_Nonnull *_Nonnull)data
813 andType: (
id _Nullable *_Nullable)type
836 ofItemAtIRI: (
OFIRI *)IRI;
859 - (void)getExtendedAttributeData: (
OFData *_Nonnull *_Nonnull)data
860 andType: (
id _Nullable *_Nullable)type
862 ofItemAtIRI: (
OFIRI *)IRI;
864 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 879 - (void)setExtendedAttributeData: (
OFData *)data
902 - (void)setExtendedAttributeData: (
OFData *)data
903 andType: (nullable
id)type
924 - (void)setExtendedAttributeData: (
OFData *)data
926 ofItemAtIRI: (
OFIRI *)IRI;
949 - (void)setExtendedAttributeData: (
OFData *)data
950 andType: (nullable
id)type
952 ofItemAtIRI: (
OFIRI *)IRI;
954 #ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES 968 - (void)removeExtendedAttributeForName: (
OFString *)name
987 - (void)removeExtendedAttributeForName: (
OFString *)name
988 ofItemAtIRI: (
OFIRI *)IRI;
991 @interface OFDictionary (FileAttributes)
997 @property (readonly, nonatomic) unsigned long long fileSize;
1011 @property (readonly, nonatomic)
unsigned long filePOSIXPermissions;
1018 @property (readonly, nonatomic)
unsigned long fileOwnerAccountID;
1025 @property (readonly, nonatomic)
unsigned long fileGroupOwnerAccountID;
1032 @property (readonly, nonatomic)
OFString *fileOwnerAccountName;
1039 @property (readonly, nonatomic)
OFString *fileGroupOwnerAccountName;
1046 @property (readonly, nonatomic)
OFDate *fileLastAccessDate;
1053 @property (readonly, nonatomic)
OFDate *fileModificationDate;
1060 @property (readonly, nonatomic)
OFDate *fileStatusChangeDate;
1067 @property (readonly, nonatomic)
OFDate *fileCreationDate;
1074 @property (readonly, nonatomic)
OFString *fileSymbolicLinkDestination;
1081 @property (readonly, nonatomic)
1096 @property (readonly, nonatomic)
OFString *fileAmigaComment;
1106 OF_ASSUME_NONNULL_END
The file can be read by group.
Definition: OFFileManager.h:83
An abstract class for storing objects in an array.
Definition: OFArray.h:108
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:136
The file cannot be executed.
Definition: OFFileManager.h:63
const OFFileAttributeKey OFFileLastAccessDate
The last access date of the file as an OFDate.
The file can be deleted by the group.
Definition: OFFileManager.h:77
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:354
The root class for all other classes inside ObjFW.
Definition: OFObject.h:954
OFIRI * currentDirectoryIRI
The IRI of the current working directory.
Definition: OFFileManager.h:372
const OFFileAttributeKey OFFileExtendedAttributesNames
The names of the extended attributes as an OFArray of OFString.
The file is a script.
Definition: OFFileManager.h:73
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.
OFFileMSDOSAttributesMask
MS-DOS attributes. This is a bit mask and the values are ORed.
Definition: OFFileManager.h:97
The file can be written to by others.
Definition: OFFileManager.h:89
OFDictionary * OFFileAttributes
A dictionary mapping keys of type OFFileAttributeKey to their attribute values.
Definition: OFFileManager.h:160
const OFFileAttributeKey OFFileGroupOwnerAccountID
The account ID of the group owner of the file as an OFNumber.
The file can be written to by the group.
Definition: OFFileManager.h:81
A class for handling strings.
Definition: OFString.h:142
The file cannot be deleted.
Definition: OFFileManager.h:61
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.
The file is a reentrant program and can be made resident.
Definition: OFFileManager.h:71
OFFileManager * defaultManager()
Returns the default file manager.
Definition: OFFileManager.m:136
The file cannot be written to.
Definition: OFFileManager.h:65
The file is read-only.
Definition: OFFileManager.h:99
An abstract class for storing and changing objects in a dictionary.
Definition: OFMutableDictionary.h:46
Provides a way to store a number in an object.
Definition: OFNumber.h:46
const OFFileAttributeKey OFFileAmigaComment
The Amiga comment as an OFString.
The file can be deleted by others.
Definition: OFFileManager.h:85
const OFFileAttributeType OFFileTypeDirectory
A directory.
const OFFileAttributeType OFFileTypeBlockSpecial
A block special file.
The file is a directory.
Definition: OFFileManager.h:107
const OFFileAttributeKey OFFileAmigaProtection
The Amiga file protection as an OFNumber.
OFFileAmigaProtectionMask
Amiga file protection. This is a bit mask and the values are ORed.
Definition: OFFileManager.h:59
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition: OFIRI.h:39
The file has not been changed since it was archived.
Definition: OFFileManager.h:69
const OFFileAttributeType OFFileTypeCharacterSpecial
A character special file.
const OFFileAttributeKey OFFilePOSIXPermissions
The POSIX permissions of the file as an OFNumber.
const OFFileAttributeKey OFFileMSDOSAttributes
The MS-DOS attributes as an OFNumber.
The file can be executed by others.
Definition: OFFileManager.h:87
A class for storing arbitrary data in an array.
Definition: OFData.h:45
The file is a volume label.
Definition: OFFileManager.h:105
The file can be executed by the group.
Definition: OFFileManager.h:79
The file is made resident on first execution.
Definition: OFFileManager.h:75
const OFFileAttributeKey OFFileCreationDate
The creation date of the file as an OFDate.
The file can be read by others.
Definition: OFFileManager.h:91
const OFFileAttributeType OFFileTypeRegular
A regular file.
The file is hidden.
Definition: OFFileManager.h:101
The file cannot be read.
Definition: OFFileManager.h:67
const OFFileAttributeType OFFileTypeUnknown
An unknown file type.
OFString * currentDirectoryPath
The path of the current working directory.
Definition: OFFileManager.h:365
The file is a system file.
Definition: OFFileManager.h:103
const OFFileAttributeKey OFFileGroupOwnerAccountName
The account name of the group owner of the file as an OFString.
The file should be archived.
Definition: OFFileManager.h:109
OFMutableDictionary * OFMutableFileAttributes
A mutable dictionary mapping keys of type OFFileAttributeKey to their attribute values.
Definition: OFFileManager.h:167
OFConstantString * OFFileAttributeType
The type of a file.
Definition: OFFileManager.h:154