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

Unified Diff: webrtc/rtc_base/unixfilesystem.cc

Issue 2891923002: Delete Filesystem::CreateFolder. (Closed)
Patch Set: Rebased. Created 3 years, 3 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 | « webrtc/rtc_base/unixfilesystem.h ('k') | webrtc/rtc_base/win32filesystem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_base/unixfilesystem.cc
diff --git a/webrtc/rtc_base/unixfilesystem.cc b/webrtc/rtc_base/unixfilesystem.cc
index 3a63e23189703f02565a2058ac48944f56c408ac..898fdd6662f64b07d27dc95c3eb06fa18c67f44c 100644
--- a/webrtc/rtc_base/unixfilesystem.cc
+++ b/webrtc/rtc_base/unixfilesystem.cc
@@ -57,39 +57,6 @@ UnixFilesystem::UnixFilesystem() {}
UnixFilesystem::~UnixFilesystem() {}
-bool UnixFilesystem::CreateFolder(const Pathname &path, mode_t mode) {
- std::string pathname(path.pathname());
- int len = pathname.length();
- if ((len == 0) || (pathname[len - 1] != '/'))
- return false;
-
- struct stat st;
- int res = ::stat(pathname.c_str(), &st);
- if (res == 0) {
- // Something exists at this location, check if it is a directory
- return S_ISDIR(st.st_mode) != 0;
- } else if (errno != ENOENT) {
- // Unexpected error
- return false;
- }
-
- // Directory doesn't exist, look up one directory level
- do {
- --len;
- } while ((len > 0) && (pathname[len - 1] != '/'));
-
- if (!CreateFolder(Pathname(pathname.substr(0, len)), mode)) {
- return false;
- }
-
- LOG(LS_INFO) << "Creating folder: " << pathname;
- return (0 == ::mkdir(pathname.c_str(), mode));
-}
-
-bool UnixFilesystem::CreateFolder(const Pathname &path) {
- return CreateFolder(path, 0755);
-}
-
bool UnixFilesystem::DeleteFile(const Pathname &filename) {
LOG(LS_INFO) << "Deleting file:" << filename.pathname();
« no previous file with comments | « webrtc/rtc_base/unixfilesystem.h ('k') | webrtc/rtc_base/win32filesystem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698