Provides functions for dealing with files
chmod(string $filename, int $mode) : bool
stringthe name and path of the file
intthe new access mode
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
booltrue on successcopy(string $filename, string $destination) : bool
stringthe name and path of the file
stringthe destination. Note that existing files get overwritten
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
booltrue on successcreate(string $filename, string $content) : bool
stringthe name and path of the new file
stringoptional content of the new file. Optional.
booltrue on success. Otherwise false.exists(string $filename) : bool
stringthe name and path of the file
booltrue if the file existsgetExtension(string $basename) : string
string
stringinfo(string $filename) : array
Currently following elements are in it: 'size' - the file size (in byte) 'atime' - the time the file was last accessed (unix timestamp) 'ctime' - time the file was created (unix timestamp) 'mtime' - time the file was last modified (unix timestamp) 'perms' - permissions of the file represented in 4 octal digits 'extension' - the file extension or '' if there's no extension 'mime' - the mime type of the file
stringthe name and path to the file
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
arrayReturns an array containing information about the filemove(string $filename, string $destination) : bool
stringthe name of the source file
stringthe destination. Note that the file can also be renamed in the process of moving it
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
booltrue on successread(string $filename, int $length, int $offset, bool $reverse) : string
stringthe name and path of the file
intthe number of bytes to read. Optional.
intthis will be the first byte which is read. Optional.
boolif true, the function will start from the back of the file. Optional.
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
stringbool success it returns the bytes which have been read.
Otherwise false.readLine(string $filename, int $lines, int $lineoffset) : string
stringthe name and path of the file
intthe number of lines to be read. Optional.
intthis will be the first line which is read. Optional.
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
stringarray bool one line was read the function will return it.
If more than one line was read the function will return an array
containing the lines. Otherwise false is returnedreadable(string $filename) : bool
stringthe name and path of the file
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
booltrue if the file is readablerecursiveRmdir(string $dirname) : bool
stringthe name of the directory which should be deleted
booltrue on success or false on failureremove(string $filename) : bool
stringthe name and path of the file
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
booltrue on successrename(string $filename, string $new_filename) : bool
stringthe name and path of the file
stringthe new name of the file
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
booltrue on successsetDefaultDirPerms(string $pathname) : boolean
stringthe name of the directory
booleantrue on success or false on failuresetDefaultFilePerms(string $filename) : boolean
stringthe name of the file
booleantrue on success or false on failuretruncate(string $filename) : bool
stringthe name and path of the file
\cInvalidArgumentException |
if the file with the given filename does not exist |
|---|
booltrue on successvalidateFilename(string $filename, boolean $notifyAndExitOnFailure) : boolean
stringthe filename to validate
booleanif set, function will show a notification and will exit the script
booleantrue if the given filename is valid, false otherwisewrite(string $filename, string $content, bool $append) : bool
stringthe name and path of the file
stringthe data which should be written
boolif true the data will be appended to the file. Optional.
booltrue on success, false otherwisewriteLine(string $filename, string $content, bool $append) : bool
| see | $content, $append) |
|---|
stringthe name and path to the file
stringthe data of the line
boolif true the data will be appended to file. Optional.
booltrue on success, false otherwisewriteable(string $filename) : bool
stringthe name and path of the file
booltrue if the file can be written