File class to wrap around the file functions
Example:
1 $file =& new File('/home/user/file');
2 if ($file->is_readable()) {
3 $contents = $file->get_contents();
4 }
See test_File.php file for examples.
Located in Program_Root/File.php (line 37)
Basename
Returns the base name of the file. If the filename ends in suffix this will also be cut off. Example:
Note: The suffix parameter was added in PHP 4.1.0.
1 $file =& new File('/home/httpd/html/index.php');
2 $basename = $file->basename(); // $basename is set to "index.php"
3 $basename = $file->basename('.php');
if filename ends in $suffix this will be cut off.
Directory name
Returns the name of the directory. On Windows, both slash (/) and backslash (\) are used as path separator character. In other environments, it is the forward slash (/).
Example:
1 $file =& new File('/etc/passwd');
2 $dirname = $file->dirname();
Get contents as array - reads entire file into an array
Real path
Expands all symbolic links and resolves references to '/./', '/../' and extra '/' characters in the input path and return the canonicalized absolute pathname.
Documention generated on Wed, 16 Jul 2003 01:03:08 +0100 by phpDocumentor 1.2.0