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

Unified Diff: runtime/bin/directory_win.cc

Issue 11175054: Change Directory.create to not fail on existing directory with that name. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comment. Created 8 years, 2 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 | « runtime/bin/directory_macos.cc ('k') | tests/standalone/io/directory_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_win.cc
diff --git a/runtime/bin/directory_win.cc b/runtime/bin/directory_win.cc
index 08d502bbfe7b0cc8bdf98b085489c5e971ff5da2..436f9875b091c933e93d29a2f6442a000566d7eb 100644
--- a/runtime/bin/directory_win.cc
+++ b/runtime/bin/directory_win.cc
@@ -348,6 +348,9 @@ char* Directory::Current() {
bool Directory::Create(const char* dir_name) {
+ // If the directory already exists and is a directory do not
+ // attempt to create it again and treat it as a success.
+ if (Exists(dir_name) == EXISTS) return true;
return (CreateDirectory(dir_name, NULL) != 0);
}
« no previous file with comments | « runtime/bin/directory_macos.cc ('k') | tests/standalone/io/directory_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698