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

Unified Diff: runtime/bin/directory_linux.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.dart ('k') | runtime/bin/directory_macos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory_linux.cc
diff --git a/runtime/bin/directory_linux.cc b/runtime/bin/directory_linux.cc
index 7adb80f9156ab2d308131aee2181243b35b85a27..59977a3886dd54334f2e220fb5cc12a5d487afb8 100644
--- a/runtime/bin/directory_linux.cc
+++ b/runtime/bin/directory_linux.cc
@@ -381,6 +381,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;
// Create the directory with the permissions specified by the
// process umask.
return (TEMP_FAILURE_RETRY(mkdir(dir_name, 0777)) == 0);
« no previous file with comments | « runtime/bin/directory.dart ('k') | runtime/bin/directory_macos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698