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

Unified Diff: base/file_util.cc

Issue 16241: file_util minor cleanup:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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
===================================================================
--- base/file_util.cc (revision 7416)
+++ base/file_util.cc (working copy)
@@ -335,6 +335,19 @@
bool CreateDirectory(const std::wstring& full_path) {
return CreateDirectory(FilePath::FromWStringHack(full_path));
}
+bool CreateNewTempDirectory(const std::wstring& prefix,
+ std::wstring* new_temp_path) {
+#if defined(OS_WIN)
+ FilePath::StringType dir_prefix(prefix);
+#elif defined(OS_POSIX)
+ FilePath::StringType dir_prefix = WideToUTF8(prefix);
+#endif
+ FilePath temp_path;
+ if (!CreateNewTempDirectory(dir_prefix, &temp_path))
+ return false;
+ *new_temp_path = temp_path.ToWStringHack();
+ return true;
+}
bool CreateTemporaryFileName(std::wstring* temp_file) {
FilePath temp_file_path;
if (!CreateTemporaryFileName(&temp_file_path))
@@ -390,6 +403,9 @@
bool PathExists(const std::wstring& path) {
return PathExists(FilePath::FromWStringHack(path));
}
+bool PathIsWritable(const std::wstring& path) {
+ return PathIsWritable(FilePath::FromWStringHack(path));
+}
bool SetCurrentDirectory(const std::wstring& directory) {
return SetCurrentDirectory(FilePath::FromWStringHack(directory));
}
« 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