Universeorange.com/Docs/

R3m/framework Features File class

The File class has these methods.

Methods:

Is

File::is($url);

Checks if the $url is a file.

Mtime

File::mtime($url);

Returns the modification time of the file.

Atime

File::atime($url);

Returns the access time of the file.

Link

File::link($source, $destination);

Creates a link from $source in $destination.

Count

File::count($directory, $include_directory=false);

Counts the amount of files in a directory. If you want to include directories in the count set $include_directory to true.

Exist

File::exist($url);

Checks if a file exists.

touch

File::touch($url='', $time=null, $atime=null);

Touches a file with $time and $atime (access time).

info

File::info(stdClass $node);

Adds information to the file.

Chown

File::chown($url='', $owner=null, $group=null, $recursive=false);

Change the owner of the $url.
If $owner and $group are null, root:root is used.
On directories $recursive can be used to include files in subdirectories.

Move

File::move($source='', $destination='', $overwrite=false);

Moves a file from $source to $destination.
If $destination exists the file is not moved until $overwrite is set to true.

Chmod

File::chmod($url, $mode=0640);

Changes the file mode of a file.

Write

File::write($url='', $data='');

Writes data $data (String) to the file $url.

Append

File::append($url='', $data='');

Appends data (String) to the file.

Read

File::read($url='');

Reads a file and returns it.

Copy

File::copy($source='', $destination='');

Copy a file from $source to $destination

Delete

File::delete($url='');

Unlink the file $url.

Extension

File::extension($url='');

Returns the file extension.

Basename

File::basename($url='', $extension='');

returns the basename of the file.

removeExtension

File::removeExtension($filename='', $extension=[]);

Removes the extension of a file.

Ucfirst

File::ucfirst($url='');

Create Capital filenames between . (dots).
For example from test.test.tpl to Test.Test.tpl.

Size

File::size($url='');

Returns the file size in bytes.

Last modified: 2021-06-07

© 2021 universeorange.com