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

Unified Diff: webrtc/rtc_base/win32filesystem.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/win32filesystem.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/rtc_base/win32filesystem.cc
diff --git a/webrtc/rtc_base/win32filesystem.cc b/webrtc/rtc_base/win32filesystem.cc
index 92ad70b1cf9009769d631bb15c967f74fdc4a724..19122e58089b4ea6ba708371e92b4400f330352a 100644
--- a/webrtc/rtc_base/win32filesystem.cc
+++ b/webrtc/rtc_base/win32filesystem.cc
@@ -33,36 +33,6 @@
namespace rtc {
-bool Win32Filesystem::CreateFolder(const Pathname &pathname) {
- if (pathname.pathname().empty() || !pathname.filename().empty())
- return false;
-
- std::wstring path16;
- if (!Utf8ToWindowsFilename(pathname.pathname(), &path16))
- return false;
-
- DWORD res = ::GetFileAttributes(path16.c_str());
- if (res != INVALID_FILE_ATTRIBUTES) {
- // Something exists at this location, check if it is a directory
- return ((res & FILE_ATTRIBUTE_DIRECTORY) != 0);
- } else if ((GetLastError() != ERROR_FILE_NOT_FOUND)
- && (GetLastError() != ERROR_PATH_NOT_FOUND)) {
- // Unexpected error
- return false;
- }
-
- // Directory doesn't exist, look up one directory level
- if (!pathname.parent_folder().empty()) {
- Pathname parent(pathname);
- parent.SetFolder(pathname.parent_folder());
- if (!CreateFolder(parent)) {
- return false;
- }
- }
-
- return (::CreateDirectory(path16.c_str(), nullptr) != 0);
-}
-
bool Win32Filesystem::DeleteFile(const Pathname &filename) {
LOG(LS_INFO) << "Deleting file " << filename.pathname();
if (!IsFile(filename)) {
« no previous file with comments | « webrtc/rtc_base/win32filesystem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698