17#import "OFDictionary.h"
19OF_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
267OF_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)
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:88
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:70
OFMutableDictionary * OFMutableFileAttributes
A mutable dictionary mapping keys of type OFFileAttributeKey to their attribute values.
Definition OFFileManager.h:101
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:94
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:105
A class for storing constant strings using the @"" literal.
Definition OFConstantString.h:38
A class for storing arbitrary data in an array.
Definition OFData.h:42
A class for storing, accessing and comparing dates.
Definition OFDate.h:30
An abstract class for storing objects in a dictionary.
Definition OFDictionary.h:80
OFArray * fileExtendedAttributesNames
Definition OFFileManager.h:893
A class which provides management for files, e.g. reading contents of directories,...
Definition OFFileManager.h:270
OFFileManager * defaultManager()
Returns the default file manager.
Definition OFFileManager.m:132
OFIRI * currentDirectoryIRI
The IRI of the current working directory.
Definition OFFileManager.h:287
OFString * currentDirectoryPath
The path of the current working directory.
Definition OFFileManager.h:280
A class for representing IRIs, URIs, URLs and URNs, for parsing them as well as accessing parts of th...
Definition OFIRI.h:37
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:688
A class for handling strings.
Definition OFString.h:135