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

Unified Diff: sdk/lib/io/directory_impl.dart

Issue 11748017: Add synchronous directory listing to dart:io Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments, move tests that fail on Windows due to VM bug 7157 to a separate test file. Created 7 years, 12 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 | « sdk/lib/io/directory.dart ('k') | tests/standalone/io/directory_error_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/directory_impl.dart
diff --git a/sdk/lib/io/directory_impl.dart b/sdk/lib/io/directory_impl.dart
index a3f8c281cfd0bac2b6c04523b582ac1d8350246f..8017e956542258c0c1299fb7058163173488eeeb 100644
--- a/sdk/lib/io/directory_impl.dart
+++ b/sdk/lib/io/directory_impl.dart
@@ -26,6 +26,7 @@ class _Directory implements Directory {
external static _create(String path);
external static _delete(String path, bool recursive);
external static _rename(String path, String newPath);
+ external static List _list(String path, bool recursive);
external static SendPort _newServicePort();
Future<bool> exists() {
@@ -229,6 +230,13 @@ class _Directory implements Directory {
return new _DirectoryLister(_path, recursive);
}
+ List listSync({bool recursive: false}) {
+ if (_path is! String || recursive is! bool) {
+ throw new ArgumentError();
+ }
+ return _list(_path, recursive);
+ }
+
String get path => _path;
String toString() => "Directory: '$path'";
« no previous file with comments | « sdk/lib/io/directory.dart ('k') | tests/standalone/io/directory_error_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698