Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3117)

Unified Diff: base/file_util.cc

Issue 83001: ImportantFileWriter (Closed)
Patch Set: share more code Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.cc
diff --git a/base/file_util.cc b/base/file_util.cc
index f7a041190581559c082f21d033faab53d4aa8983..8eec3ac2bf1863f28a271e06fd09447c1ac9443a 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -188,6 +188,14 @@ bool ReadFileToString(const FilePath& path, std::string* contents) {
return true;
}
+FILE* CreateAndOpenTemporaryFile(FilePath* path) {
+ FilePath directory;
+ if (!GetTempDir(&directory))
+ return false;
+
+ return CreateAndOpenTemporaryFileInDir(directory, path);
+}
+
bool GetFileSize(const FilePath& file_path, int64* file_size) {
FileInfo info;
if (!GetFileInfo(file_path, &info))
« no previous file with comments | « base/file_util.h ('k') | base/file_util_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698