17 #import "OFDictionary.h"
19 OF_ASSUME_NONNULL_BEGIN
24 # if defined(OF_HAVE_CHMOD) && !defined(OF_AMIGAOS)
25 # define OF_FILE_MANAGER_SUPPORTS_PERMISSIONS
27 # if defined(OF_HAVE_CHOWN) && !defined(OF_AMIGAOS)
28 # define OF_FILE_MANAGER_SUPPORTS_OWNER
30 # if (defined(OF_HAVE_LINK) && !defined(OF_AMIGAOS)) || defined(OF_WINDOWS)
31 # define OF_FILE_MANAGER_SUPPORTS_LINKS
33 # if (defined(OF_HAVE_SYMLINK) && !defined(OF_AMIGAOS)) || defined(OF_WINDOWS)
34 # define OF_FILE_MANAGER_SUPPORTS_SYMLINKS
38 @class OFArray OF_GENERIC(ObjectType);
243 #ifndef OF_FILE_MANAGER_M
244 OF_SUBCLASSING_RESTRICTED
247 #ifdef OF_HAVE_CLASS_PROPERTIES
310 ofItemAtURL: (
OFURL *)URL;
319 - (bool)fileExistsAtPath: (
OFString *)path;
328 - (bool)fileExistsAtURL: (
OFURL *)URL;
337 - (bool)directoryExistsAtPath: (
OFString *)path;
346 - (bool)directoryExistsAtURL: (
OFURL *)URL;
354 - (void)createDirectoryAtPath: (
OFString *)path;
362 - (void)createDirectoryAtPath: (
OFString *)path
363 createParents: (
bool)createParents;
371 - (void)createDirectoryAtURL: (
OFURL *)URL;
379 - (void)createDirectoryAtURL: (
OFURL *)URL createParents: (
bool)createParents;
409 - (void)changeCurrentDirectoryPath: (
OFString *)path;
416 - (void)changeCurrentDirectoryURL: (
OFURL *)URL;
447 - (void)copyItemAtURL: (
OFURL *)source toURL: (
OFURL *)destination;
479 - (void)moveItemAtURL: (
OFURL *)source toURL: (
OFURL *)destination;
489 - (void)removeItemAtPath: (
OFString *)path;
499 - (void)removeItemAtURL: (
OFURL *)URL;
501 #ifdef OF_FILE_MANAGER_SUPPORTS_LINKS
527 - (void)linkItemAtURL: (
OFURL *)source toURL: (
OFURL *)destination;
529 #ifdef OF_FILE_MANAGER_SUPPORTS_SYMLINKS
544 - (void)createSymbolicLinkAtPath: (
OFString *)path
545 withDestinationPath: (
OFString *)target;
562 - (void)createSymbolicLinkAtURL: (
OFURL *)URL
563 withDestinationPath: (
OFString *)target;
566 @interface OFDictionary (FileAttributes)
572 @property (readonly, nonatomic)
unsigned long long fileSize;
587 @property (readonly, nonatomic)
unsigned long filePOSIXPermissions;
594 @property (readonly, nonatomic)
unsigned long filePOSIXUID;
601 @property (readonly, nonatomic)
unsigned long filePOSIXGID;
608 @property (readonly, nonatomic)
OFString *fileOwner;
615 @property (readonly, nonatomic)
OFString *fileGroup;
623 @property (readonly, nonatomic)
OFDate *fileLastAccessDate;
631 @property (readonly, nonatomic)
OFDate *fileModificationDate;
639 @property (readonly, nonatomic)
OFDate *fileStatusChangeDate;
646 @property (readonly, nonatomic)
OFDate *fileCreationDate;
654 @property (readonly, nonatomic)
OFString *fileSymbolicLinkDestination;
657 OF_ASSUME_NONNULL_END
OFConstantString * of_file_attribute_key_t
A key for a file attribute in the file attributes dictionary.
Definition: OFFileManager.h:42
const of_file_type_t of_file_type_socket
A socket.
Definition: OFFileManager.m:106
const of_file_attribute_key_t of_file_attribute_key_group
The group of the file as an OFString.
Definition: OFFileManager.m:86
const of_file_type_t of_file_type_regular
A regular file.
Definition: OFFileManager.m:99
const of_file_attribute_key_t of_file_attribute_key_last_access_date
The last access date of the file as an OFDate.
Definition: OFFileManager.m:88
const of_file_attribute_key_t of_file_attribute_key_posix_permissions
The POSIX permissions of the file as an OFNumber.
Definition: OFFileManager.m:78
const of_file_attribute_key_t of_file_attribute_key_type
The type of the file.
Definition: OFFileManager.m:76
const of_file_attribute_key_t of_file_attribute_key_posix_gid
The POSIX GID of the file as an OFNumber.
Definition: OFFileManager.m:82
const of_file_attribute_key_t of_file_attribute_key_modification_date
The last modification date of the file as an OFDate.
Definition: OFFileManager.m:90
const of_file_type_t of_file_type_character_special
A character special file.
Definition: OFFileManager.m:103
const of_file_attribute_key_t of_file_attribute_key_status_change_date
The last status change date of the file as an OFDate.
Definition: OFFileManager.m:92
const of_file_type_t of_file_type_block_special
A block special file.
Definition: OFFileManager.m:105
const of_file_attribute_key_t of_file_attribute_key_symbolic_link_destination
The destination of a symbolic link as an OFString.
Definition: OFFileManager.m:96
const of_file_type_t of_file_type_fifo
A FIFO.
Definition: OFFileManager.m:102
const of_file_attribute_key_t of_file_attribute_key_size
The size of the file as an OFNumber.
Definition: OFFileManager.m:74
OFMutableDictionary * of_mutable_file_attributes_t
A mutable dictionary mapping keys of type of_file_attribute_key_t to their attribute values.
Definition: OFFileManager.h:95
OFConstantString * of_file_type_t
The type of a file.
Definition: OFFileManager.h:81
const of_file_type_t of_file_type_directory
A directory.
Definition: OFFileManager.m:100
const of_file_attribute_key_t of_file_attribute_key_creation_date
The creation date of the file as an OFDate.
Definition: OFFileManager.m:94
OFDictionary * of_file_attributes_t
A dictionary mapping keys of type of_file_attribute_key_t to their attribute values.
Definition: OFFileManager.h:88
const of_file_attribute_key_t of_file_attribute_key_owner
The owner of the file as an OFString.
Definition: OFFileManager.m:84
const of_file_type_t of_file_type_symbolic_link
A symbolic link.
Definition: OFFileManager.m:101
const of_file_attribute_key_t of_file_attribute_key_posix_uid
The POSIX UID of the file as an OFNumber.
Definition: OFFileManager.m:80
An abstract class for storing objects in an array.
Definition: OFArray.h:92
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:42
A class for storing, accessing and comparing dates.
Definition: OFDate.h:36
An abstract class for storing objects in a dictionary.
Definition: OFDictionary.h:58
A class which provides management for files, e.g. reading contents of directories,...
Definition: OFFileManager.h:247
OFFileManager * defaultManager()
Returns the default file manager.
Definition: OFFileManager.m:155
OFURL * currentDirectoryURL
The URL of the current working directory.
Definition: OFFileManager.h:260
OFString * currentDirectoryPath
The path of the current working directory.
Definition: OFFileManager.h:255
An abstract class for storing and changing objects in a dictionary.
Definition: OFMutableDictionary.h:44
The root class for all other classes inside ObjFW.
Definition: OFObject.h:520
A class for handling strings.
Definition: OFString.h:132
A class for parsing URLs and accessing parts of it.
Definition: OFURL.h:34