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

Side by Side Diff: utils/pub/io.dart

Issue 12314153: dart:io | Rename File.name to File.path. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove stray line break. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Helper functionality to make working with IO easier. 5 /// Helper functionality to make working with IO easier.
6 library io; 6 library io;
7 7
8 import 'dart:async'; 8 import 'dart:async';
9 import 'dart:io'; 9 import 'dart:io';
10 import 'dart:isolate'; 10 import 'dart:isolate';
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 listedDirectories = new Set<String>.from(listedDirectories); 154 listedDirectories = new Set<String>.from(listedDirectories);
155 listedDirectories.add(resolvedPath); 155 listedDirectories.add(resolvedPath);
156 156
157 log.io("Listing directory $dir."); 157 log.io("Listing directory $dir.");
158 var lister = new Directory(dir).list(); 158 var lister = new Directory(dir).list();
159 159
160 var children = []; 160 var children = [];
161 lister.listen( 161 lister.listen(
162 (entity) { 162 (entity) {
163 if (entity is File) { 163 if (entity is File) {
164 var file = entity.name; 164 var file = entity.path;
165 if (!includeHiddenFiles && path.basename(file).startsWith('.')) { 165 if (!includeHiddenFiles && path.basename(file).startsWith('.')) {
166 return; 166 return;
167 } 167 }
168 contents.add(path.join(dir, path.basename(file))); 168 contents.add(path.join(dir, path.basename(file)));
169 } else if (entity is Directory) { 169 } else if (entity is Directory) {
170 var file = entity.path; 170 var file = entity.path;
171 if (!includeHiddenFiles && path.basename(file).startsWith('.')) { 171 if (!includeHiddenFiles && path.basename(file).startsWith('.')) {
172 return; 172 return;
173 } 173 }
174 file = path.join(dir, path.basename(file)); 174 file = path.join(dir, path.basename(file));
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 const PubProcessResult(this.stdout, this.stderr, this.exitCode); 804 const PubProcessResult(this.stdout, this.stderr, this.exitCode);
805 805
806 bool get success => exitCode == 0; 806 bool get success => exitCode == 0;
807 } 807 }
808 808
809 /// Gets a [Uri] for [uri], which can either already be one, or be a [String]. 809 /// Gets a [Uri] for [uri], which can either already be one, or be a [String].
810 Uri _getUri(uri) { 810 Uri _getUri(uri) {
811 if (uri is Uri) return uri; 811 if (uri is Uri) return uri;
812 return Uri.parse(uri); 812 return Uri.parse(uri);
813 } 813 }
OLDNEW
« runtime/bin/file_android.cc ('K') | « tests/standalone/io/windows_environment_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698