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

Side by Side Diff: runtime/bin/file.dart

Issue 10639004: Add .fromPath constructors to File and Directory. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years, 6 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
« no previous file with comments | « runtime/bin/directory_impl.dart ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5
6 /** 6 /**
7 * FileMode describes the modes in which a file can be opened. 7 * FileMode describes the modes in which a file can be opened.
8 */ 8 */
9 class FileMode { 9 class FileMode {
10 static final READ = const FileMode._internal(0); 10 static final READ = const FileMode._internal(0);
(...skipping 11 matching lines...) Expand all
22 * streams using [openInputStream] and [openOutputStream] or open the 22 * streams using [openInputStream] and [openOutputStream] or open the
23 * file for random access operations using [open]. 23 * file for random access operations using [open].
24 */ 24 */
25 interface File default _File { 25 interface File default _File {
26 /** 26 /**
27 * Create a File object. 27 * Create a File object.
28 */ 28 */
29 File(String name); 29 File(String name);
30 30
31 /** 31 /**
32 * Create a File object from a Path object.
33 */
34 File.fromPath(Path path);
35
36 /**
32 * Check if the file exists. Does not block and returns a 37 * Check if the file exists. Does not block and returns a
33 * [:Future<bool>:]. 38 * [:Future<bool>:].
34 */ 39 */
35 Future<bool> exists(); 40 Future<bool> exists();
36 41
37 /** 42 /**
38 * Synchronously check if the file exists. 43 * Synchronously check if the file exists.
39 */ 44 */
40 bool existsSync(); 45 bool existsSync();
41 46
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 sb.add(" ($osError)"); 386 sb.add(" ($osError)");
382 } 387 }
383 } else if (osError != null) { 388 } else if (osError != null) {
384 sb.add(": osError"); 389 sb.add(": osError");
385 } 390 }
386 return sb.toString(); 391 return sb.toString();
387 } 392 }
388 final String message; 393 final String message;
389 final OSError osError; 394 final OSError osError;
390 } 395 }
OLDNEW
« no previous file with comments | « runtime/bin/directory_impl.dart ('k') | runtime/bin/file_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698