Skip to main content
Version: Fegg 5.x

File::copyFile

Copy a file

Description​

public bool File::copyFile( string $source, string $dest )

Copies $source to $dest and sets the permission of the copy to 0644 (readable by everyone). Returns false when $source is not a file or the copy fails.

Arguments​

NameData typeDefaultRemarks
$sourcestringSource file
$deststringDestination file

Example​

Controller
use Fegg\Tool\File;

$file = new File();
$file->copyFile('path/to/foo.txt', 'path/to/bar.txt');