OFFile Class Reference

A class which provides functions to read, write and manipulate files. More...

#import <OFFile.h>

Inheritance diagram for OFFile:
OFStream OFObject

List of all members.

Public Member Functions

(id) - initWithPath:mode:
(id) - initWithFilePointer:

Static Public Member Functions

(id) + fileWithPath:mode:
(id) + fileWithFilePointer:
(void) + changeModeOfFile:toMode:
(void) + changeOwnerOfFile:toOwner:group:
(void) + rename:to:
(void) + delete:
(void) + link:to:
(void) + symlink:to:

Protected Attributes

FILE * fp
BOOL close

Detailed Description

A class which provides functions to read, write and manipulate files.


Member Function Documentation

+ (void) changeModeOfFile: (OFString*)  path
toMode: (mode_t)  mode 

Changes the mode of a file.

Only changes read-only flag on Windows.

Parameters:
path The path to the file of which the mode should be changed as a string
mode The new mode for the file
+ (void) changeOwnerOfFile: (OFString*)  path
toOwner: (uid_t)  owner
group: (gid_t)  group 

Changes the owner of a file.

Not available on Windows.

Parameters:
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) delete: (OFString*)  path  

Deletes a file.

Parameters:
path The path to the file of which should be deleted as a string
+ (id) fileWithFilePointer: (FILE*)  fp  
Parameters:
fp A file pointer, returned from for example fopen(). It is not closed when the OFFile object is deallocated!
Returns:
A new autoreleased OFFile
+ (id) fileWithPath: (OFString*)  path
mode: (OFString*)  mode 
Parameters:
path The path to the file to open as a string
mode The mode in which the file should be opened as a string
Returns:
A new autoreleased OFFile
- (id) initWithFilePointer: (FILE*)  fp  

Initializes an already allocated OFFile.

Parameters:
fp A file pointer, returned from for example fopen(). It is not closed when the OFFile object is deallocated!
- (id) initWithPath: (OFString*)  path
mode: (OFString*)  mode 

Initializes an already allocated OFFile.

Parameters:
path The path to the file to open as a string
mode The mode in which the file should be opened as a string
Returns:
An initialized OFFile
+ (void) link: (OFString*)  src
to: (OFString*)  dest 

Hardlinks a file.

Not available on Windows.

Parameters:
src The path to the file of which should be linked as a string
dest The path to where the file should be linked as a string
+ (void) rename: (OFString*)  from
to: (OFString*)  to 

Renames a file.

Parameters:
from The file to rename
to The new name
+ (void) symlink: (OFString*)  src
to: (OFString*)  dest 

Symlinks a file.

Not available on Windows.

Parameters:
src The path to the file of which should be symlinked as a string
dest The path to where the file should be symlinked as a string

The documentation for this class was generated from the following files:
 All Classes Functions Variables

Generated on Sun Mar 14 13:41:05 2010 for ObjFW by  doxygen 1.6.1