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

Unified Diff: base/file_util_posix.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_posix.cc
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 018a48dde19058be24928cef3acb50ad1f5f391e..f438253761dd98ef220c40f65adf306b4bbcdf6e 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -227,7 +227,7 @@ bool CopyDirectory(const FilePath& from_path,
// This function does not properly handle destinations within the source
FilePath real_to_path = to_path;
- if (file_util::PathExists(real_to_path)) {
+ if (PathExists(real_to_path)) {
real_to_path = MakeAbsoluteFilePath(real_to_path);
if (real_to_path.empty())
return false;
@@ -309,6 +309,11 @@ bool CopyDirectory(const FilePath& from_path,
return success;
}
+bool PathExists(const FilePath& path) {
+ ThreadRestrictions::AssertIOAllowed();
+ return access(path.value().c_str(), F_OK) == 0;
+}
+
} // namespace base
// -----------------------------------------------------------------------------
@@ -324,11 +329,6 @@ using base::MakeAbsoluteFilePath;
using base::RealPath;
using base::VerifySpecificPathControlledByUser;
-bool PathExists(const FilePath& path) {
- base::ThreadRestrictions::AssertIOAllowed();
- return access(path.value().c_str(), F_OK) == 0;
-}
-
bool PathIsWritable(const FilePath& path) {
base::ThreadRestrictions::AssertIOAllowed();
return access(path.value().c_str(), W_OK) == 0;
« no previous file with comments | « base/file_util.h ('k') | base/file_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698