#include <filesystem.hpp>
◆ MoveStatus
| Enumerator |
|---|
| MOVE_SUCCESS | File moved successfully (atomic or copy)
|
| MOVE_IO_ERR | Disk Full, Permission on dest, or other IO error.
|
| MOVE_SYS_ERR | Permission on src, rename() failed for system reasons.
|
| MOVE_INVALID_STATE | File is not open or already moved.
|
◆ TempFile() [1/2]
| utils::TempFile::TempFile |
( |
| ) |
|
◆ ~TempFile()
| utils::TempFile::~TempFile |
( |
| ) |
|
◆ TempFile() [2/2]
| utils::TempFile::TempFile |
( |
TempFile const & | TempFile | ) |
|
|
private |
◆ close()
| void utils::TempFile::close |
( |
| ) |
|
◆ fd()
| int utils::TempFile::fd |
( |
| ) |
const |
◆ isOpen()
| bool utils::TempFile::isOpen |
( |
| ) |
const |
◆ moveTo()
Moves the temporary file to a new permanent location.
Attempts an atomic rename(). If that fails (e.g. cross-device move), it falls back to a manual copy followed by unlinking the source.
- Note
- IMPORTANT: On success, this TempFile object is invalidated (FD closed, path cleared). Ownership of the physical file is transferred to
destPath. The file will NOT be deleted when this object is destroyed.
- Parameters
-
| destPath | Absolute path to the destination file. |
- Returns
- MoveStatus indicating success or the specific type of failure.
◆ open()
| bool utils::TempFile::open |
( |
| ) |
|
◆ operator int()
| utils::TempFile::operator int |
( |
| ) |
const |
◆ operator=()
◆ path()
| std::string const & utils::TempFile::path |
( |
| ) |
const |
◆ fd_
◆ filePath_
| std::string utils::TempFile::filePath_ |
|
private |
The documentation for this class was generated from the following files: