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

Unified Diff: base/file_util.h

Issue 14886003: Make base:ReplaceFile return an informative error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: respond to comments Created 7 years, 7 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 | « no previous file | base/file_util.cc » ('j') | base/file_util_win.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util.h
diff --git a/base/file_util.h b/base/file_util.h
index 4ffd05babda8018f625cbf237d2101a058604bae..6400a9b7e471f5cdd17a88d049fc7c87e249338b 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -101,7 +101,13 @@ BASE_EXPORT bool MoveUnsafe(const base::FilePath& from_path,
// volume, or the function will fail. Destination file will be created
// if it doesn't exist. Prefer this function over Move when dealing with
// temporary files. On Windows it preserves attributes of the target file.
-// Returns true on success.
+// Returns true on success, leaving *error unchanged.
+// Returns false on failure and sets *error appropriately, if it is non-NULL.
+BASE_EXPORT bool ReplaceFile(const base::FilePath& from_path,
jar (doing other things) 2013/05/07 22:31:32 nit: You can't overload functions, so you need a d
dgrogan 2013/05/07 22:45:16 Done. I went with ReplaceFileAndGetError.
+ const base::FilePath& to_path,
+ base::PlatformFileError* error);
+
+// Backward-compatible convenience method for the above.
BASE_EXPORT bool ReplaceFile(const base::FilePath& from_path,
const base::FilePath& to_path);
« no previous file with comments | « no previous file | base/file_util.cc » ('j') | base/file_util_win.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698