|
| bool | exists (std::string path) |
| | Tells if #path exists.
|
| off_t | size (std::string path) |
| | Returns the file size of #path in bytes.
|
| void | mkdir_p (std::string path) |
| | Creates #path directory hierarchy recursively, just like UNIX command mkdir -p.
|
| void | rm_rf (std::string path) |
| | Removes recursively all files within directory at #path, just like UNIX command rm -rf.
|
| void | rm_f (std::string path) |
| | Forcibly removes file within #path.
|
| bool | create (std::string path) |
| | Creates empty file #path.
|
| void | write (std::string path, std::string contents) |
| | Writes #contents to #path.
|
| bool | isDirectory (std::string path) |
| | Tells if #path is a directory.
|
| bool | isFile (std::string path) |
| | Tells if #path is a regular file (not a directory, socket, FIFO device or whatever).
|
| std::vector< std::string > | ls (std::string path) |
| | Lists all files withing #path.
|
| std::string | getHome () |
| | Gets the full path of the home directory for the user running this program.
|
| std::string | getUser () |
| | Gets the user name of the person running this program.
|
| std::string | basename (std::string path) |
| | Returns the component of a pathname (file name and extension).
|
| std::string | dropBasename (std::string path) |
| | Returns the full pathname up to the last component.
|
| std::string | extension (std::string path) |
| | Returns the extension of a file.
|
| std::string | dropExtension (std::string path) |
| | Returns the filename without it's extension.
|
File I/O and Operational System's utilities.
Note, I'm using several POSIX functions. So the following functions surely aren't portable to Windows. Other systems are kinda unpredictable.