copy() is used to copy
files. If the target already exists, the file is copied only if the source
modification date is later than the target. This behavior can be overridden by
the third boolean argument:

1
2
3
4
5

// works only if image-ICC has been modified after image.jpg$fs->copy('image-ICC.jpg','image.jpg');// image.jpg will be overridden$fs->copy('image-ICC.jpg','image.jpg',true);

touch() sets access and
modification time for a file. The current time is used by default. You can set
your own with the second argument. The third argument is the access time:

1
2
3
4
5
6

// set modification time to the current timestamp$fs->touch('file.txt');// set modification time 10 seconds in the future$fs->touch('file.txt',time()+10);// set access time 10 seconds in the past$fs->touch('file.txt',time(),time()-10);

Note

You can pass an array or any Traversable object as the first
argument.

symlink() creates a
symbolic link from the target to the destination. If the filesystem does not
support symbolic links, a third boolean argument is available:

1
2
3
4
5

// create a symbolic link$fs->symlink('/path/to/source','/path/to/destination');// duplicate the source directory if the filesystem// does not support symbolic links$fs->symlink('/path/to/source','/path/to/destination',true);