LLVM 20.0.0git
|
Represents a temporary file. More...
#include "llvm/Support/FileSystem.h"
Public Member Functions | |
TempFile (TempFile &&Other) | |
TempFile & | operator= (TempFile &&Other) |
Error | keep (const Twine &Name) |
Error | keep () |
Error | discard () |
~TempFile () | |
Static Public Member Functions | |
static Expected< TempFile > | create (const Twine &Model, unsigned Mode=all_read|all_write, OpenFlags ExtraFlags=OF_None) |
This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal. | |
Public Attributes | |
std::string | TmpName |
int | FD = -1 |
Represents a temporary file.
The temporary file must be eventually discarded or given a final name and kept.
The destructor doesn't implicitly discard because there is no way to properly handle errors in a destructor.
Definition at line 847 of file FileSystem.h.
llvm::sys::fs::TempFile::TempFile | ( | TempFile && | Other | ) |
Definition at line 1211 of file Path.cpp.
References llvm::Other.
llvm::sys::fs::TempFile::~TempFile | ( | ) |
Definition at line 1224 of file Path.cpp.
References assert(), and llvm::Done.
|
static |
This creates a temporary file with createUniqueFile and schedules it for deletion with sys::RemoveFileOnSignal.
Definition at line 1325 of file Path.cpp.
References llvm::consumeError(), llvm::sys::fs::createUniqueFile(), llvm::errorCodeToError(), H, llvm::sys::fs::OF_Delete, llvm::operation_not_permitted, and llvm::sys::RemoveFileOnSignal().
Referenced by createOnDiskBuffer(), llvm::localCache(), llvm::writeArchive(), llvm::writeToOutput(), and llvm::object::writeUniversalBinary().
Error llvm::sys::fs::TempFile::discard | ( | ) |
Definition at line 1226 of file Path.cpp.
References llvm::Done, llvm::sys::DontRemoveFileOnSignal(), llvm::errnoAsErrorCode(), llvm::errorCodeToError(), and llvm::sys::fs::remove().
Referenced by llvm::localCache().
Error llvm::sys::fs::TempFile::keep | ( | ) |
Definition at line 1305 of file Path.cpp.
References assert(), llvm::Done, llvm::sys::DontRemoveFileOnSignal(), llvm::errnoAsErrorCode(), llvm::errorCodeToError(), H, and llvm::Error::success().
Definition at line 1254 of file Path.cpp.
References assert(), llvm::sys::fs::copy_file(), llvm::Done, llvm::sys::DontRemoveFileOnSignal(), llvm::errnoAsErrorCode(), llvm::errorCodeToError(), H, Name, llvm::sys::fs::remove(), and llvm::sys::fs::rename().
Referenced by llvm::localCache().
Definition at line 1212 of file Path.cpp.
References llvm::Other.
int llvm::sys::fs::TempFile::FD = -1 |
Definition at line 864 of file FileSystem.h.
Referenced by llvm::localCache().
std::string llvm::sys::fs::TempFile::TmpName |
Definition at line 861 of file FileSystem.h.
Referenced by llvm::localCache().