21#import "OFDictionary.h"
23OF_ASSUME_NONNULL_BEGIN
28# if (defined(OF_HAVE_CHMOD) && !defined(OF_AMIGAOS) && \
29 !defined(OF_NINTENDO_DS)) || defined(DOXYGEN)
30# define OF_FILE_MANAGER_SUPPORTS_PERMISSIONS
32# if (defined(OF_HAVE_CHOWN) && !defined(OF_AMIGAOS)) || defined(DOXYGEN)
33# define OF_FILE_MANAGER_SUPPORTS_OWNER
35# if (defined(OF_HAVE_LINK) && !defined(OF_AMIGAOS) && !defined(OF_HAIKU) && \
36 !defined(OF_NINTENDO_DS)) || defined(OF_WINDOWS) || defined(DOXYGEN)
37# define OF_FILE_MANAGER_SUPPORTS_LINKS
39# if (defined(OF_HAVE_SYMLINK) && !defined(OF_AMIGAOS) && \
40 !defined(OF_NINTENDO_DS)) || defined(OF_WINDOWS) || defined(DOXYGEN)
41# define OF_FILE_MANAGER_SUPPORTS_SYMLINKS
43# if defined(OF_LINUX) || defined(OF_MACOS) || defined(OF_FREEBSD) || \
44 defined(OF_NETBSD) || defined(OF_HAIKU) || defined(OF_SOLARIS) || \
46# define OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES
50@class OFArray OF_GENERIC(ObjectType);
273#ifndef OF_FILE_MANAGER_M
274OF_SUBCLASSING_RESTRICTED
277#ifdef OF_HAVE_CLASS_PROPERTIES
370- (bool)fileExistsAtPath: (
OFString *)path;
381- (bool)fileExistsAtIRI: (
OFIRI *)IRI;
390- (bool)directoryExistsAtPath: (
OFString *)path;
401- (bool)directoryExistsAtIRI: (
OFIRI *)IRI;
410- (void)createDirectoryAtPath: (
OFString *)path;
420- (void)createDirectoryAtPath: (
OFString *)path
421 createParents: (
bool)createParents;
432- (void)createDirectoryAtIRI: (
OFIRI *)IRI;
444- (void)createDirectoryAtIRI: (
OFIRI *)IRI createParents: (
bool)createParents;
494- (void)changeCurrentDirectoryPath: (
OFString *)path;
503- (void)changeCurrentDirectoryIRI: (
OFIRI *)IRI;
542- (void)copyItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
592- (void)moveItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
603- (void)removeItemAtPath: (
OFString *)path;
616- (void)removeItemAtIRI: (
OFIRI *)IRI;
618#ifdef OF_FILE_MANAGER_SUPPORTS_LINKS
652- (void)linkItemAtIRI: (
OFIRI *)source toIRI: (
OFIRI *)destination;
654#ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS
672- (void)createSymbolicLinkAtPath: (
OFString *)path
673 withDestinationPath: (
OFString *)target;
693- (void)createSymbolicLinkAtIRI: (
OFIRI *)IRI
694 withDestinationPath: (
OFString *)target;
696#ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES
734- (void)getExtendedAttributeData: (
OFData *_Nonnull *_Nonnull)data
735 andType: (
id _Nullable *_Nullable)type
758 ofItemAtIRI: (
OFIRI *)IRI;
781- (void)getExtendedAttributeData: (
OFData *_Nonnull *_Nonnull)data
782 andType: (
id _Nullable *_Nullable)type
784 ofItemAtIRI: (
OFIRI *)IRI;
786#ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES
801- (void)setExtendedAttributeData: (
OFData *)data
824- (void)setExtendedAttributeData: (
OFData *)data
825 andType: (nullable
id)type
846- (void)setExtendedAttributeData: (
OFData *)data
848 ofItemAtIRI: (
OFIRI *)IRI;
871- (void)setExtendedAttributeData: (
OFData *)data
872 andType: (nullable
id)type
874 ofItemAtIRI: (
OFIRI *)IRI;
876#ifdef OF_FILE_MANAGER_SUPPORTS_EXTENDED_ATTRIBUTES
890- (void)removeExtendedAttributeForName: (
OFString *)name
909- (void)removeExtendedAttributeForName: (
OFString *)name
910 ofItemAtIRI: (
OFIRI *)IRI;
913@interface OFDictionary (FileAttributes)
919@property (readonly, nonatomic)
unsigned long long fileSize;
933@property (readonly, nonatomic)
unsigned long filePOSIXPermissions;
940@property (readonly, nonatomic)
unsigned long fileOwnerAccountID;
947@property (readonly, nonatomic)
unsigned long fileGroupOwnerAccountID;
954@property (readonly, nonatomic)
OFString *fileOwnerAccountName;
961@property (readonly, nonatomic)
OFString *fileGroupOwnerAccountName;
968@property (readonly, nonatomic)
OFDate *fileLastAccessDate;
975@property (readonly, nonatomic)
OFDate *fileModificationDate;
982@property (readonly, nonatomic)
OFDate *fileStatusChangeDate;
989@property (readonly, nonatomic)
OFDate *fileCreationDate;
996@property (readonly, nonatomic)
OFString *fileSymbolicLinkDestination;
1003@property (readonly, nonatomic)
1007OF_ASSUME_NONNULL_END
const OFFileAttributeType OFFileTypeFIFO
A FIFO.
const OFFileAttributeKey OFFileCreationDate
The creation date of the file as an OFDate.
const OFFileAttributeKey OFFileOwnerAccountName
The account name of the owner of the file as an OFString.
const OFFileAttributeKey OFFileExtendedAttributesNames
The names of the extended attributes as an OFArray of OFString.
const OFFileAttributeKey OFFilePOSIXPermissions
The POSIX permissions of the file as an OFNumber.
OFConstantString * OFFileAttributeType
The type of a file.
Definition OFFileManager.h:95
const OFFileAttributeType OFFileTypeBlockSpecial
A block special file.
const OFFileAttributeKey OFFileGroupOwnerAccountID
The account ID of the group owner of the file as an OFNumber.
const OFFileAttributeKey OFFileGroupOwnerAccountName
The account name of the group owner of the file as an OFString.
const OFFileAttributeType OFFileTypeSocket
A socket.
const OFFileAttributeKey OFFileStatusChangeDate
The last status change date of the file as an OFDate.
OFConstantString * OFFileAttributeKey
A key for a file attribute in the file attributes dictionary.
Definition OFFileManager.h:77
OFMutableDictionary * OFMutableFileAttributes
A mutable dictionary mapping keys of type OFFileAttributeKey to their attribute values.
Definition OFFileManager.h:108
const OFFileAttributeType OFFileTypeRegular
A regular file.
const OFFileAttributeKey OFFileSymbolicLinkDestination
The destination of a symbolic link as an OFString.
const OFFileAttributeKey OFFileType
The type of the file.
const OFFileAttributeKey OFFileModificationDate
The last modification date of the file as an OFDate.
const OFFileAttributeType OFFileTypeCharacterSpecial
A character special file.
const OFFileAttributeKey OFFileSize
The size of the file as an OFNumber.
const OFFileAttributeType OFFileTypeSymbolicLink
A symbolic link.
const OFFileAttributeKey OFFileOwnerAccountID
The account ID of the owner of the file as an OFNumber.
const OFFileAttributeType OFFileTypeUnknown
An unknown file type.
OFDictionary * OFFileAttributes
A dictionary mapping keys of type OFFileAttributeKey to their attribute values.
Definition OFFileManager.h:101
const OFFileAttributeKey OFFileLastAccessDate
The last access date of the file as an OFDate.
const OFFileAttributeType OFFileTypeDirectory
A directory.
An abstract class for storing objects in an array.
Definition OFArray.h:109
A class for storing constant strings using the @"" literal.
Definition OFConstantString.h:42
A class for storing arbitrary data in an array.
Definition OFData.h:46
A class for storing, accessing and comparing dates.
Definition OFDate.h:34
An abstract class for storing objects in a dictionary.
Definition OFDictionary.h:84
OFArray * fileExtendedAttributesNames
The OFFileExtendedAttributesNames key from the dictionary.
Definition OFFileManager.h:1004
A class which provides management for files, e.g. reading contents of directories,...
Definition OFFileManager.h:277
OFFileManager * defaultManager()
Returns the default file manager.
Definition OFFileManager.m:136
OFIRI * currentDirectoryIRI
The IRI of the current working directory.
Definition OFFileManager.h:294
OFString * currentDirectoryPath
The path of the current working directory.
Definition OFFileManager.h:287
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition OFIRI.h:41
An abstract class for storing and changing objects in a dictionary.
Definition OFMutableDictionary.h:48
The root class for all other classes inside ObjFW.
Definition OFObject.h:692
A class for handling strings.
Definition OFString.h:143