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

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: ToT 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') | no next file with comments »
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..034d67c564f841e417b67476e1aa2a36cfe317ac 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 ReplaceFileAndGetError(const base::FilePath& from_path,
+ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698