forked from OSchip/llvm-project
Add an F_Delete flag.
For now this only changes the handle Access. llvm-svn: 319121
This commit is contained in:
parent
dbd4a7fecc
commit
bce112c9e9
|
@ -683,7 +683,11 @@ enum OpenFlags : unsigned {
|
|||
F_Text = 4,
|
||||
|
||||
/// Open the file for read and write.
|
||||
F_RW = 8
|
||||
F_RW = 8,
|
||||
|
||||
/// The returned handle can be used for deleting the file. Only makes a
|
||||
/// difference on windows.
|
||||
F_Delete = 16
|
||||
};
|
||||
|
||||
/// @brief Create a uniquely named file.
|
||||
|
|
|
@ -1031,6 +1031,8 @@ std::error_code openFileForWrite(const Twine &Name, int &ResultFD,
|
|||
DWORD Access = GENERIC_WRITE;
|
||||
if (Flags & F_RW)
|
||||
Access |= GENERIC_READ;
|
||||
if (Flags & F_Delete)
|
||||
Access |= DELETE;
|
||||
|
||||
HANDLE H =
|
||||
::CreateFileW(PathUTF16.begin(), Access,
|
||||
|
|
Loading…
Reference in New Issue