Returns last modified time, or false in case of an error. Returns the file’s group, or false in case of an error. Cake\Filesystem\File:: delete ( ) ¶ĭeletes the file. Cake\Filesystem\File:: create ( ) ¶Ĭreates the file. Cake\Filesystem\File:: copy ( string $dest, boolean $overwrite = true ) ¶Ĭopy the file to the absolute path $dest. Cake\Filesystem\File:: close ( ) ¶Ĭloses the current file if it is opened. Cake\Filesystem\File:: append ( string $data, boolean $force = false ) ¶Īppend the given data string to the current file. property Cake\Filesystem\File::$ lock ¶Įnable locking for file reading and writing. Holds the file handler resource if the file is opened. property Cake\Filesystem\File::$ handle ¶
property Cake\Filesystem\File::$ info ¶Īn array of file info. Differs fromįile::name() which returns the name without the extension. Create a new file with 0644 permissions $file = new File ( '/path/to/file.php', true, 0644 ) property Cake\Filesystem\File::$ Folder ¶ Can be used to createĭeep path structures like /foo/bar/baz/shoe/horn: Cake\Filesystem\Folder:: create ( string $pathname, integer $mode = false ) ¶Ĭreate a directory structure recursively. Returns a correct set of slashes for given $path (’\’ for
Static Cake\Filesystem\Folder:: correctSlashFor ( string $path ) ¶ Will be removed and replaced with the source’s. If both the target andĭestination contain the same subdirectory, the target directory’s contents Directoryįolder::OVERWRITE overwrite existing files & directories in the targetĭirectory with those in the source directory. Source directory will replace files in the target directory. ]) įolder::SKIP skip copying/moving files & directories that exist in theįolder::MERGE merge the source/destination directories. $folder1 = new Folder ( '/path/to/folder1' ) $folder1 -> copy ( '/path/to/folder2' ) // Will put folder1 and all its contents into folder2 $folder = new Folder ( '/path/to/folder' ) $folder -> copy (, 'scheme' => Folder :: SKIP // Skip directories/files that already exist.