| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |