|
uvw
1.10.0
|
#include <fs.hpp>


Public Member Functions | |
| void | unlink (std::string path) |
| Async unlink. More... | |
| bool | unlinkSync (std::string path) |
| Sync unlink. More... | |
| void | mkdir (std::string path, int mode) |
| Async mkdir. More... | |
| bool | mkdirSync (std::string path, int mode) |
| Sync mkdir. More... | |
| void | mkdtemp (std::string tpl) |
| Async mktemp. More... | |
| std::pair< bool, const char * > | mkdtempSync (std::string tpl) |
| Sync mktemp. More... | |
| void | rmdir (std::string path) |
| Async rmdir. More... | |
| bool | rmdirSync (std::string path) |
| Sync rmdir. More... | |
| void | scandir (std::string path, int flags) |
| Async scandir. More... | |
| std::pair< bool, std::size_t > | scandirSync (std::string path, int flags) |
| Sync scandir. More... | |
| std::pair< bool, Entry > | scandirNext () |
| Gets entries populated with the next directory entry data. More... | |
| void | stat (std::string path) |
| Async stat. More... | |
| std::pair< bool, Stat > | statSync (std::string path) |
| Sync stat. More... | |
| void | lstat (std::string path) |
| Async lstat. More... | |
| std::pair< bool, Stat > | lstatSync (std::string path) |
| Sync lstat. More... | |
| void | rename (std::string old, std::string path) |
| Async rename. More... | |
| bool | renameSync (std::string old, std::string path) |
| Sync rename. More... | |
| void | copyfile (std::string old, std::string path, Flags< CopyFile > flags=Flags< CopyFile >{}) |
| Copies a file asynchronously from a path to a new one. More... | |
| bool | copyfileSync (std::string old, std::string path, Flags< CopyFile > flags=Flags< CopyFile >{}) |
| Copies a file synchronously from a path to a new one. More... | |
| void | access (std::string path, int mode) |
| Async access. More... | |
| bool | accessSync (std::string path, int mode) |
| Sync access. More... | |
| void | chmod (std::string path, int mode) |
| Async chmod. More... | |
| bool | chmodSync (std::string path, int mode) |
| Sync chmod. More... | |
| void | utime (std::string path, Time atime, Time mtime) |
| Async utime. More... | |
| bool | utimeSync (std::string path, Time atime, Time mtime) |
| Sync utime. More... | |
| void | link (std::string old, std::string path) |
| Async link. More... | |
| bool | linkSync (std::string old, std::string path) |
| Sync link. More... | |
| void | symlink (std::string old, std::string path, Flags< SymLink > flags=Flags< SymLink >{}) |
| Async symlink. More... | |
| bool | symlinkSync (std::string old, std::string path, Flags< SymLink > flags=Flags< SymLink >{}) |
| Sync symlink. More... | |
| void | readlink (std::string path) |
| Async readlink. More... | |
| std::pair< bool, std::pair< const char *, std::size_t > > | readlinkSync (std::string path) |
| Sync readlink. More... | |
| void | realpath (std::string path) |
| Async realpath. More... | |
| std::pair< bool, const char * > | realpathSync (std::string path) |
| Sync realpath. More... | |
| void | chown (std::string path, Uid uid, Gid gid) |
| Async chown. More... | |
| bool | chownSync (std::string path, Uid uid, Gid gid) |
| Sync chown. More... | |
| void | lchown (std::string path, Uid uid, Gid gid) |
| Async lchown. More... | |
| bool | lchownSync (std::string path, Uid uid, Gid gid) |
| Sync lchown. More... | |
The FsReq request.
Cross-platform sync and async filesystem operations.
All file operations are run on the threadpool.
To create a FsReq through a Loop, no arguments are required.
See the official documentation for further details.
|
inline |
Async access.
Emit a FsEvent<FsReq::Type::ACCESS> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
| mode | Mode, as described in the official documentation. |
|
inline |
|
inline |
Async chmod.
Emit a FsEvent<FsReq::Type::CHMOD> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
| mode | Mode, as described in the official documentation. |
|
inline |
Async chown.
Emit a FsEvent<FsReq::Type::CHOWN> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
| uid | UID, as described in the official documentation. |
| gid | GID, as described in the official documentation. |
|
inline |
Copies a file asynchronously from a path to a new one.
Emit a FsEvent<FsReq::Type::UV_FS_COPYFILE> event when completed.
Emit an ErrorEvent event in case of errors.
Available flags are:
FsReq::CopyFile::EXCL: it fails if the destination path already exists (the default behavior is to overwrite the destination if it exists).FsReq::CopyFile::FICLONE: If present, it will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then a fallback copy mechanism is used.FsReq::CopyFile::FICLONE_FORCE: If present, it will attempt to create a copy-on-write reflink. If the underlying platform does not support copy-on-write, then an error is returned.| old | Old path, as described in the official documentation. |
| path | New path, as described in the official documentation. |
| flags | Optional additional flags. |
|
inline |
Copies a file synchronously from a path to a new one.
Available flags are:
FsReq::CopyFile::EXCL: it fails if the destination path already exists (the default behavior is to overwrite the destination if it exists).If the destination path is created, but an error occurs while copying the data, then the destination path is removed. There is a brief window of time between closing and removing the file where another process could access the file.
| old | Old path, as described in the official documentation. |
| path | New path, as described in the official documentation. |
| flags | Optional additional flags. |
Async lchown.
Emit a FsEvent<FsReq::Type::LCHOWN> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
| uid | UID, as described in the official documentation. |
| gid | GID, as described in the official documentation. |
|
inline |
Async link.
Emit a FsEvent<FsReq::Type::LINK> event when completed.
Emit an ErrorEvent event in case of errors.
| old | Old path, as described in the official documentation. |
| path | New path, as described in the official documentation. |
|
inline |
|
inline |
Async lstat.
Emit a FsEvent<FsReq::Type::LSTAT> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
|
inline |
|
inline |
Async mkdir.
Emit a FsEvent<FsReq::Type::MKDIR> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
| mode | Mode, as described in the official documentation. |
|
inline |
|
inline |
Async mktemp.
Emit a FsEvent<FsReq::Type::MKDTEMP> event when completed.
Emit an ErrorEvent event in case of errors.
| tpl | Template, as described in the official documentation. |
|
inline |
|
inline |
Async readlink.
Emit a FsEvent<FsReq::Type::READLINK> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
|
inline |
Sync readlink.
| path | Path, as described in the official documentation. |
std::pair composed as it follows:std::pair composed as it follows:
|
inline |
Async realpath.
Emit a FsEvent<FsReq::Type::REALPATH> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
|
inline |
|
inline |
Async rename.
Emit a FsEvent<FsReq::Type::RENAME> event when completed.
Emit an ErrorEvent event in case of errors.
| old | Old path, as described in the official documentation. |
| path | New path, as described in the official documentation. |
|
inline |
|
inline |
Async rmdir.
Emit a FsEvent<FsReq::Type::RMDIR> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
|
inline |
|
inline |
|
inline |
Gets entries populated with the next directory entry data.
Returns instances of Entry, that is an alias for a pair where:
std::string that contains the actual value.Available entry types are:
FsReq::EntryType::UNKNOWNFsReq::EntryType::FILEFsReq::EntryType::DIRFsReq::EntryType::LINKFsReq::EntryType::FIFOFsReq::EntryType::SOCKETFsReq::EntryType::CHARFsReq::EntryType::BLOCKSee the official documentation for further details.
Entry (see above).
|
inline |
|
inline |
Async stat.
Emit a FsEvent<FsReq::Type::STAT> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
|
inline |
|
inline |
Async symlink.
Emit a FsEvent<FsReq::Type::SYMLINK> event when completed.
Emit an ErrorEvent event in case of errors.
Available flags are:
FsReq::SymLink::DIR: it indicates that the old path points to a directory.FsReq::SymLink::JUNCTION: it requests that the symlink is created using junction points.| old | Old path, as described in the official documentation. |
| path | New path, as described in the official documentation. |
| flags | Optional additional flags. |
|
inline |
Sync symlink.
Available flags are:
FsReq::SymLink::DIR: it indicates that the old path points to a directory.FsReq::SymLink::JUNCTION: it requests that the symlink is created using junction points.| old | Old path, as described in the official documentation. |
| path | New path, as described in the official documentation. |
| flags | Flags, as described in the official documentation. |
|
inline |
Async unlink.
Emit a FsEvent<FsReq::Type::UNLINK> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
|
inline |
|
inline |
Async utime.
Emit a FsEvent<FsReq::Type::UTIME> event when completed.
Emit an ErrorEvent event in case of errors.
| path | Path, as described in the official documentation. |
| atime | std::chrono::duration<double>, having the same meaning as described in the official documentation. |
| mtime | std::chrono::duration<double>, having the same meaning as described in the official documentation. |
|
inline |
Sync utime.
| path | Path, as described in the official documentation. |
| atime | std::chrono::duration<double>, having the same meaning as described in the official documentation. |
| mtime | std::chrono::duration<double>, having the same meaning as described in the official documentation. |
1.8.13