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

Unified Diff: runtime/bin/directory.dart

Issue 8277033: Add exists, create and delete to directory implementation on Linux and Mac. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix Windows build. Created 9 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.cc ('k') | runtime/bin/directory_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/directory.dart
diff --git a/runtime/bin/directory.dart b/runtime/bin/directory.dart
index a94658e4444989c61977a9329ec55132db62db3e..072adb68ca19afd11a5a0bc8a6d97bb40fc30611 100644
--- a/runtime/bin/directory.dart
+++ b/runtime/bin/directory.dart
@@ -8,7 +8,24 @@ interface Directory factory _Directory {
* relative to the directory in which the Dart VM was
* started.
*/
- Directory(String dir);
+ Directory(String path);
+
+ /**
+ * Returns whether a directory with this name already exists.
+ */
+ bool exists();
+
+ /**
+ * Creates the directory with this name if it does not exist.
+ * Throw an exception if the directory already exists.
+ */
+ void create();
+
+ /**
+ * Deletes the directory with this name. Throws an exception
+ * if the directory is not empty or if deletion failed.
+ */
+ void delete();
/**
* List the sub-directories and files of this
@@ -46,4 +63,9 @@ interface Directory factory _Directory {
* directories.
*/
void setErrorHandler(void errorHandler(String error));
+
+ /**
+ * Gets the path of this directory.
+ */
+ final String path;
}
« no previous file with comments | « runtime/bin/directory.cc ('k') | runtime/bin/directory_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698