Class cDirHandler
Class for directory handling. Provides functions for dealing with
directories.
Methods summary
public static
boolean
|
#
create( string $pathname, boolean $recursive = false )
Creates a new dir.
Parameters
- $pathname
string $pathname the name and path of the new dir
- $recursive
boolean $recursive
Returns
boolean Returns true on success or false on failure.
|
public static
boolean
|
#
remove( string $dirname )
Removes a dir from the filesystem
Removes a dir from the filesystem
Parameters
- $dirname
string $dirname The path to the directory
Returns
boolean Returns true on success or false on failure.
Throws
|
public static
boolean
|
#
move( string $dirname, string $destination )
Moves a dir
Parameters
- $dirname
string $dirname The path and name of the directory
- $destination
string $destination the destination. Note that the dir can also be renamed in the
process of moving it
Returns
boolean Returns true on success or false on failure.
Throws
|
public static
|
#
rename( string $dirname, string $new_dirname )
Renames a dir
Parameters
- $dirname
string $dirname the name and path of the dir
- $new_dirname
string $new_dirname the new name of the dir
|
public static
boolean
|
#
chmod( string $dirname, integer $mode )
Changes the dir permissions
Changes the dir permissions
Parameters
- $dirname
string $dirname the name and path of the dir
- $mode
integer $mode the new access mode : php chmod needs octal value
Returns
boolean Returns true on success or false on failure.
Throws
|
public static
boolean
|
#
setDefaultDirPerms( string $dirname )
Sets the default directory permissions on the given directory.
Sets the default directory permissions on the given directory.
Parameters
- $dirname
string $dirname the name of the directory
Returns
boolean Returns true on success or false on failure.
|
public static
boolean
|
#
recursiveRmdir( string $dirname )
Deletes a directory and all of its content.
Deletes a directory and all of its content.
Parameters
- $dirname
string $dirname the name of the directory which should be deleted
Returns
boolean Returns true on success or false on failure.
|
public static
|
#
read( string $dirName, boolean $recursive = false, boolean $dirOnly = false )
This functions reads the content from given directory. optionally options are
to read the directory recursive or to list only directories.
This functions reads the content from given directory. optionally options are
to read the directory recursive or to list only directories.
Parameters
- $dirName
string $dirName directory
- $recursive
boolean $recursive flag to read recursive
- $dirOnly
boolean $dirOnly flag to list only directories
|
public static
|
|