Index: base/file_util_win.cc |
=================================================================== |
--- base/file_util_win.cc (revision 8817) |
+++ base/file_util_win.cc (working copy) |
@@ -395,6 +395,10 @@ |
return true; |
} |
+bool GetShmemTempDir(FilePath* path) { |
+ return GetTempDir(path); |
+} |
+ |
bool CreateTemporaryFileName(FilePath* path) { |
std::wstring temp_path, temp_file; |
@@ -409,6 +413,22 @@ |
return false; |
} |
+// On POSIX we have semantics to create and open a temporary file |
+// atomically. |
+// TODO(jrg): is there equivalent call to use on Windows instead of |
+// going 2-step? |
+FILE* CreateAndOpenTemporaryFile(FilePath* path) { |
+ |
+ if (!CreateTemporaryFileName(path)) { |
+ return NULL; |
+ } |
+ return OpenFile(*path, "w+"); |
+} |
+ |
+FILE* CreateAndOpenTemporaryShmemFile(FilePath* path) { |
+ return CreateAndOpenTemporaryFile(path); |
+} |
+ |
bool CreateTemporaryFileNameInDir(const std::wstring& dir, |
std::wstring* temp_file) { |
wchar_t temp_name[MAX_PATH + 1]; |