Represents a file in the filesystem.
More...
List of all members.
Public Member Functions |
| __construct ($name, $fs=false) |
| Filename of file you wish to instantiate.
|
| getName () |
| Returns the filename of the file.
|
| getDirectory () |
| Returns directory of the file without trailing slash.
|
| get () |
| Retrieves the contents of a file.
|
| write ($contents) |
| Writes contents to a file, creates new file if necessary.
|
| delete () |
| Deletes the file.
|
| exists () |
| Returns true if file exists and is a file.
|
| getMTime () |
| Returns last file modification time.
|
| chmod ($octal_code) |
| Chmod a file.
|
| open ($mode) |
| Opens file's handle.
|
| close () |
| Closes file's handle.
|
| getLine ($length=null) |
| Retrieves a line from an open file, with optional max length $length.
|
| getChar () |
| Retrieves a character from an open file.
|
| read ($length) |
| Retrieves an $length bytes of data from an open data.
|
| put ($string) |
| Writes to an open file.
|
| eof () |
| Returns TRUE if the end of the file has been reached.
|
| __destruct () |
Protected Attributes |
| $name |
| Filename of file this object represents.
|
| $handle = false |
| Handle for the file.
|
| $fs |
| Instance of FSTools for interfacing with filesystem.
|
Detailed Description
Represents a file in the filesystem.
- Warning:
- Be sure to distinguish between get() and write() versus read() and put(), the former operates on the entire file, while the latter operates on a handle.
Definition at line 10 of file File.php.
Constructor & Destructor Documentation
FSTools_File::__construct |
( |
$ |
name, |
|
|
$ |
fs = false |
|
) |
| |
FSTools_File::__destruct |
( |
| ) |
|
Member Function Documentation
FSTools_File::chmod |
( |
$ |
octal_code | ) |
|
Chmod a file.
- Note:
- We ignore errors because of some weird owner trickery due to SVN duality
Definition at line 70 of file File.php.
Deletes the file.
Definition at line 51 of file File.php.
Returns TRUE if the end of the file has been reached.
Definition at line 115 of file File.php.
Returns true if file exists and is a file.
Definition at line 56 of file File.php.
Retrieves the contents of a file.
- Todo:
- Throw an exception if file doesn't exist
Definition at line 41 of file File.php.
FSTools_File::getChar |
( |
| ) |
|
Retrieves a character from an open file.
Definition at line 97 of file File.php.
References open().
FSTools_File::getDirectory |
( |
| ) |
|
Returns directory of the file without trailing slash.
Definition at line 35 of file File.php.
FSTools_File::getLine |
( |
$ |
length = null | ) |
|
Retrieves a line from an open file, with optional max length $length.
Definition at line 90 of file File.php.
References open().
FSTools_File::getMTime |
( |
| ) |
|
Returns last file modification time.
Definition at line 61 of file File.php.
FSTools_File::getName |
( |
| ) |
|
Returns the filename of the file.
Definition at line 32 of file File.php.
FSTools_File::open |
( |
$ |
mode | ) |
|
FSTools_File::put |
( |
$ |
string | ) |
|
FSTools_File::read |
( |
$ |
length | ) |
|
Retrieves an $length bytes of data from an open data.
Definition at line 103 of file File.php.
References open().
FSTools_File::write |
( |
$ |
contents | ) |
|
Writes contents to a file, creates new file if necessary.
Definition at line 46 of file File.php.
Member Data Documentation
FSTools_File::$fs [protected] |
FSTools_File::$handle = false [protected] |
Handle for the file.
Definition at line 17 of file File.php.
FSTools_File::$name [protected] |
The documentation for this class was generated from the following file:
- /home/ezyang/Dev/htmlpurifier/extras/FSTools/File.php