strukt / fs
Strukt Filesystem
Installs: 1 132
Dependents: 4
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: ^8.1
- strukt/base: v1.0.0
Requires (Dev)
- mikey179/vfsstream: ^1.6
This package is auto-updated.
Last update: 2024-12-21 08:44:26 UTC
README
Basic filesystem functionality.
Usage
Strukt\Fs::isDir(file) //Directory Exists Strukt\Fs::isFile(file) //File Exists Strukt\Fs::isPath(path) //Path Esists Strukt\Fs::cat(file) //Dump File Contents Strukt\Fs::touch(file) //Create File Strukt\Fs::touchWrite(file, contents) //Create Write To File Strukt\Fs::rename(from, to) //Rename File Strukt\Fs::overwrite(file, contents) //Overwrite File Contents Strukt\Fs::appendWrite(file, contents) //Append Contents To File Strukt\Fs::rm(file) //Delete File Strukt\Fs::rmdir(dir) //Recursively Delete Strukt\Fs::mkdir(dir) //Recursively Create Strukt\Fs::isWritable(file) //Check If File Is Writeable Strukt\Fs::isReadable(file) //Check If File is Readable Strukt\Fs::copyRecur(source,destination) //Copy recursively Strukt\Fs::cpr(source,destination) //Alias for copyRecur Strukt\Fs::listFilesRecur(path) //List directory files recursively Strukt\Fs::lsr(path) //Alias for listFilesRecur Strukt\Fs::tail(filepath, lines = 20) //read last line of file: default 20 lines Strukt\Fs::isWindows()//Is OS Windows Strukt\Fs::dirSep(path)//OS appropriate directory separator on path Strukt\Fs::ds(path)//Alisas for dirSep