ObjFW
|
A class which provides functions to read, write and manipulate files. More...
#import <OFFile.h>
Public Member Functions | |
(id) | - initWithPath:mode: |
Initializes an already allocated OFFile. | |
(id) | - initWithFileDescriptor: |
Initializes an already allocated OFFile. | |
Static Public Member Functions | |
(id) | + fileWithPath:mode: |
Creates a new OFFile with the specified path and mode. | |
(id) | + fileWithFileDescriptor: |
Creates a new OFFile with the specified file descriptor. | |
(OFString *) | + currentDirectoryPath |
Returns the path fo the current working directory. | |
(BOOL) | + fileExistsAtPath: |
Checks whether a file exists at the specified path. | |
(BOOL) | + directoryExistsAtPath: |
Checks whether a directory exists at the specified path. | |
(void) | + createDirectoryAtPath: |
Creates a directory at the specified path. | |
(OFArray *) | + filesInDirectoryAtPath: |
Returns an array with the files in the specified directory. | |
(void) | + changeToDirectory: |
Changes the current working directory. | |
(OFDate *) | + modificationDateOfFile: |
Returns the date of the last modification of the file. | |
(void) | + changeModeOfFile:toMode: |
Changes the mode of a file. | |
(void) | + changeOwnerOfFile:toOwner:group: |
Changes the owner of a file. | |
(void) | + copyFileAtPath:toPath: |
Copies a file. | |
(void) | + renameFileAtPath:toPath: |
Renames a file. | |
(void) | + deleteFileAtPath: |
Deletes a file. | |
(void) | + deleteDirectoryAtPath: |
Deletes an empty directory. | |
(void) | + linkFileAtPath:toPath: |
Creates a hard link for a file. | |
(void) | + symlinkFileAtPath:toPath: |
Creates a symbolink link for a file. |
A class which provides functions to read, write and manipulate files.
+ (void) changeModeOfFile: | (OFString*) | path | |
toMode: | (mode_t) | mode | |
Changes the mode of a file.
Only changes read-only flag on Windows.
path | The path to the file of which the mode should be changed as a string |
mode | The new mode for the file |
Changes the owner of a file.
Not available on Windows.
path | The path to the file of which the owner should be changed as a string |
owner | The new owner for the file |
group | The new group for the file |
+ (void) changeToDirectory: | (OFString*) | path |
Changes the current working directory.
path | The new directory to change to |
Copies a file.
source | The file to copy |
destination | The destination path |
+ (void) createDirectoryAtPath: | (OFString*) | path |
Creates a directory at the specified path.
path | The path of the directory |
+ (OFString *) currentDirectoryPath |
Returns the path fo the current working directory.
+ (void) deleteDirectoryAtPath: | (OFString*) | path |
Deletes an empty directory.
path | The path to the directory which should be deleted as a string |
+ (void) deleteFileAtPath: | (OFString*) | path |
Deletes a file.
path | The path to the file of which should be deleted as a string |
+ (BOOL) directoryExistsAtPath: | (OFString*) | path |
Checks whether a directory exists at the specified path.
path | The path to check |
+ (BOOL) fileExistsAtPath: | (OFString*) | path |
Checks whether a file exists at the specified path.
path | The path to check |
Returns an array with the files in the specified directory.
path | The path of the directory |
+ (id) fileWithFileDescriptor: | (int) | fileDescriptor |
- (id) initWithFileDescriptor: | (int) | fileDescriptor |
Creates a hard link for a file.
Not available on Windows.
source | The path to the file of which should be linked as a string |
destination | The path to where the file should be linked as a string |
Returns the date of the last modification of the file.
Renames a file.
source | The file to rename |
destination | The new name |
Creates a symbolink link for a file.
Not available on Windows.
source | The path to the file of which should be symlinked as a string |
destination | The path to where the file should be symlinked as a string |