FileDirectory
in package
File system tools
Table of Contents
- Copy() : void
- Copies file or folders to target directory
- Delete() : bool
- Deletes file or directory (even if directory is not empty)
- FormatDirectoryPath() : string
- Formats path to target, including returning to parent directories
- RecursiveChmod() : void
- Sets permission mode for target directory and all its content (Linux systems only)
Methods
Copy()
Copies file or folders to target directory
public
static Copy(string $source, string $target) : void
Parameters
- $source : string
-
File or directory
- $target : string
-
Target directory
Return values
void —Delete()
Deletes file or directory (even if directory is not empty)
public
static Delete(string $path) : bool
Parameters
- $path : string
-
Path to target file or directory
Return values
bool —Returns TRUE if target was deleted successfully. Returns FALSE if an error occurred.
FormatDirectoryPath()
Formats path to target, including returning to parent directories
public
static FormatDirectoryPath(string $path) : string
Parameters
- $path : string
-
Non-formatted path (for example "/var/www/../log")
Return values
string —Example: "/var/log/"
RecursiveChmod()
Sets permission mode for target directory and all its content (Linux systems only)
public
static RecursiveChmod(int $mode, string $target) : void
Parameters
- $mode : int
- $target : string