File locations of this process. More...
Enumerations | |
| enum class | Error { Success = 0 , Permission , NotFound , Failed } |
| File enumerators. More... | |
Functions | |
| StormByte::Error::Fault | LastError () noexcept |
| Last File error on this thread. | |
| bool | Temporary (StormByte::String::String &path, std::string_view prefix="TMP", std::string_view suffix={}) |
| Create a unique empty temporary file. | |
| bool | CurrentExecutable (StormByte::String::String &path) |
| Full path of the running executable. | |
File locations of this process.
Each call returns true on success and updates LastError for this thread. An output String is valid only when the call returned true. The caller unlinks a file created by Temporary.
|
strong |
File enumerators.
Domain tag StormByte.System.File. Zero is success.
| Enumerator | |
|---|---|
| Success | No error. |
| Permission | The process may not create or read this file. |
| NotFound | The file could not be resolved. |
| Failed | The platform call failed. |
| bool StormByte::System::File::CurrentExecutable | ( | StormByte::String::String & | path | ) |
Full path of the running executable.
| [out] | path | Absolute file path. Written only on success. |
|
noexcept |
| bool StormByte::System::File::Temporary | ( | StormByte::String::String & | path, |
| std::string_view | prefix = "TMP", |
||
| std::string_view | suffix = {} |
||
| ) |
Create a unique empty temporary file.
| [out] | path | Absolute path of the created file. Written only on success. |
| prefix | File-name prefix. Default "TMP". | |
| suffix | File-name suffix (including a leading dot if wanted). Default empty. |
POSIX uses mkstemp / mkstemps. Windows uses GetTempFileNameW and only the first three prefix characters; the suffix is appended after the generated name when it is not empty.