Class FSTools_File
Inheritance | FSTools_File |
---|
Represents a file in the filesystem
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$fs | Instance of FSTools for interfacing with filesystem | FSTools_File | |
$handle | Handle for the file | FSTools_File | |
$name | Filename of file this object represents | FSTools_File |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Filename of file you wish to instantiate. | FSTools_File |
__destruct() | FSTools_File | |
chmod() | Chmod a file | FSTools_File |
close() | Closes file's handle | FSTools_File |
delete() | Deletes the file | FSTools_File |
eof() | Returns TRUE if the end of the file has been reached | FSTools_File |
exists() | Returns true if file exists and is a file. | FSTools_File |
get() | Retrieves the contents of a file | FSTools_File |
getChar() | Retrieves a character from an open file | FSTools_File |
getDirectory() | Returns directory of the file without trailing slash | FSTools_File |
getLine() | Retrieves a line from an open file, with optional max length $length | FSTools_File |
getMTime() | Returns last file modification time | FSTools_File |
getName() | Returns the filename of the file. | FSTools_File |
open() | Opens file's handle | FSTools_File |
put() | Writes to an open file | FSTools_File |
read() | Retrieves an $length bytes of data from an open data | FSTools_File |
write() | Writes contents to a file, creates new file if necessary | FSTools_File |
Property Details
Method Details
Filename of file you wish to instantiate.
public void __construct ( $name, $fs = false ) | ||
$name | ||
$fs |
public void __destruct ( ) |
Chmod a file
public void chmod ( $octal_code ) | ||
$octal_code |
Closes file's handle
public void close ( ) |
Deletes the file
public void delete ( ) |
Returns TRUE if the end of the file has been reached
public void eof ( ) |
Returns true if file exists and is a file.
public void exists ( ) |
Retrieves the contents of a file
public void get ( ) |
Retrieves a character from an open file
public void getChar ( ) |
Returns directory of the file without trailing slash
public void getDirectory ( ) |
Retrieves a line from an open file, with optional max length $length
public void getLine ( $length = null ) | ||
$length |
Returns last file modification time
public void getMTime ( ) |
Returns the filename of the file.
public void getName ( ) |
Opens file's handle
public void open ( $mode ) | ||
$mode |
Writes to an open file
public void put ( $string ) | ||
$string |
Retrieves an $length bytes of data from an open data
public void read ( $length ) | ||
$length |
Writes contents to a file, creates new file if necessary
public void write ( $contents ) | ||
$contents |