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. | |
Definition at line 10 of file File.php.
| FSTools_File::__construct | ( | $ | name, | |
| $ | fs = false | |||
| ) |
Filename of file you wish to instantiate.
Definition at line 26 of file File.php.
References $fs, $name, and FSTools::singleton().
| FSTools_File::getDirectory | ( | ) |
| FSTools_File::get | ( | ) |
| FSTools_File::write | ( | $ | contents | ) |
| FSTools_File::exists | ( | ) |
| FSTools_File::getMTime | ( | ) |
| FSTools_File::chmod | ( | $ | octal_code | ) |
| FSTools_File::open | ( | $ | mode | ) |
| FSTools_File::close | ( | ) |
Closes file's handle.
Definition at line 82 of file File.php.
Referenced by __destruct(), and open().
| FSTools_File::getLine | ( | $ | length = null |
) |
| FSTools_File::getChar | ( | ) |
| FSTools_File::read | ( | $ | length | ) |
| FSTools_File::put | ( | $ | string | ) |
| FSTools_File::eof | ( | ) |
FSTools_File::$name [protected] |
Filename of file this object represents.
Definition at line 14 of file File.php.
Referenced by __construct().
FSTools_File::$handle = false [protected] |
FSTools_File::$fs [protected] |
Instance of FSTools for interfacing with filesystem.
Definition at line 20 of file File.php.
Referenced by __construct().
1.5.3