fsΒΆ

File system management. This package extends basic os package file capabilities

Functions:

boolean absolute fs.absolute ( string path ) Tells if the given path is absolute or relative
boolean result fs.access ( string file , string mode ) test a file for read, write or both access
boolean success fs.copy ( string source , string destination ) Copy a file or directory into a destination directory
boolean success fs.delete ( string path ) Delete a file or directory, directory must be empty to be deleted
string,table filename,stat fs.dir ( string directory , [nil|string|table] pattern ) Iterates over the given directory
string path fs.expand ( string file ) expand a path using environment variables and normalizes the slashes for the current operating system.
table sequences fs.lseq ( string path ) List the files in given path and look for sequences of files
boolean success fs.mkdir ( string directory ) create a new directory
boolean success fs.mkdirtree ( string directory ) create a new directory with all needed parents
boolean success fs.remove ( string path ) Remove a file or an empty directory
boolean success fs.rename ( string old , string new ) Rename a file or directory, new name must not exist
boolean success fs.rmdir ( string directory ) delete a directory even if non empty
string,string,string,string,string directory,basename,extension,separator,frame fs.splitpath ( string path , bool withframes ) Split the file into directory, basename, extension and optionally frame number
table stat fs.stat ( string file ) get file stat