|
static bool | remove (const Path &path, std::nothrow_t) noexcept |
| Deletes the file or directory. Returns false on error. More...
|
|
static void | remove (const Path &path) |
| Deletes the file or directory. Throws an exception on error. More...
|
|
static bool | rename (const Path &from, const Path &to, std::nothrow_t) noexcept |
| Renames the file. More...
|
|
static void | rename (const Path &from, const Path &to, bool ignore_missing=false) |
| Renames the file. More...
|
|
static bool | copy (const Path &from, const Path &to, std::nothrow_t) |
| Copies a file. Returns false on error. More...
|
|
static void | copy (const Path &from, const Path &to) |
| Copies a file. More...
|
|
static void | copy (std::istream &from, std::ostream &to, std::streamsize limit=0U, std::string::size_type block=0U) |
| Copies a stream with an optional size limit. More...
|
|
static bool | copyInto (const Path &from, const Path &to_dir, std::nothrow_t) |
| Copies a file into a directory and does a chmodx() if necessary. More...
|
|
static bool | mkdirs (const Path &dir, std::nothrow_t, int=100) |
| Creates a directory and all necessary parents. More...
|
|
static void | mkdirs (const Path &dir, int=100) |
| Creates a directory and all necessary parents. More...
|
|
static bool | mkdir (const Path &dir, std::nothrow_t) |
| Creates a directory. More...
|
|
static void | mkdir (const Path &dir) |
| Creates a directory. More...
|
|
static bool | isEmpty (const Path &file, std::nothrow_t) |
| Returns true if the file size is zero. More...
|
|
static std::string | sizeString (const Path &file) |
| Returns the file's size in string format. More...
|
|
static bool | exists (const Path &file) |
| Returns true if the file (directory, device etc.) exists. More...
|
|
static bool | exists (const Path &file, std::nothrow_t) |
| Returns true if the file (directory, device etc.) exists. More...
|
|
static bool | isExecutable (const Path &, std::nothrow_t) |
| Returns true if the path is probably executable by the calling process. More...
|
|
static bool | isLink (const Path &path, std::nothrow_t) |
| Returns true if the path is an existing symlink. More...
|
|
static bool | isDirectory (const Path &path, std::nothrow_t) |
| Returns true if the path exists() and is a directory. More...
|
|
static SystemTime | time (const Path &file) |
| Returns the file's timestamp. Throws on error. More...
|
|
static SystemTime | time (const Path &file, std::nothrow_t) |
| Returns the file's timestamp. More...
|
|
static void | chmodx (const Path &file) |
| Makes the file executable. Throws on error. More...
|
|
static bool | chmodx (const Path &file, std::nothrow_t) |
| Makes the file executable. More...
|
|
static void | chmod (const Path &file, const std::string &spec) |
| Sets the file permissions. More...
|
|
static void | chgrp (const Path &file, const std::string &group) |
| Sets the file group ownership. Throws on error. More...
|
|
static bool | chgrp (const Path &file, const std::string &group, std::nothrow_t) |
| Sets the file group ownership. Returns false on error. More...
|
|
static G::Path | readlink (const Path &link) |
| Reads a symlink. Throws on error. More...
|
|
static G::Path | readlink (const Path &link, std::nothrow_t) |
| Reads a symlink. Returns the empty path on error. More...
|
|
static void | link (const Path &target, const Path &new_link) |
| Creates a symlink. More...
|
|
static bool | link (const Path &target, const Path &new_link, std::nothrow_t) |
| Creates a symlink. Returns false on error. More...
|
|
static void | create (const Path &) |
| Creates the file if it does not exist. More...
|
|
static int | compare (const Path &, const Path &, bool ignore_whitespace=false) |
| Compares the contents of the two files. Returns 0, 1 or -1. More...
|
|
static void | open (std::ofstream &, const Path &) |
| Calls open() on the given output file stream. More...
|
|
static void | open (std::ofstream &, const Path &, Append) |
| Calls open() on the given output file stream. More...
|
|
static void | open (std::ofstream &, const Path &, Text) |
| Calls open() on the given output file stream. More...
|
|
static void | open (std::ifstream &, const Path &) |
| Calls open() on the given input file stream. More...
|
|
static void | open (std::ifstream &, const Path &, Text) |
| Calls open() on the given input file stream. More...
|
|
static std::filebuf * | open (std::filebuf &, const Path &, InOut) |
| Calls open() on the given filebuf. More...
|
|
static int | open (const char *, InOutAppend) noexcept |
| Opens a file descriptor. More...
|
|
static bool | probe (const char *) noexcept |
| Creates and deletes a temporary probe file. More...
|
|
static ssize_t | read (int fd, char *, std::size_t) noexcept |
| Calls ::read() or equivalent. More...
|
|
static ssize_t | write (int fd, const char *, std::size_t) noexcept |
| Calls ::write() or equivalent. More...
|
|
static void | close (int fd) noexcept |
| Calls ::close() or equivalent. More...
|
|
A simple static class for dealing with files.
- See also
- G::Path, G::FileSystem, G::Directory
Definition at line 42 of file gfile.h.