| 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 part of dart.io; | 5 part of dart.io; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * FileMode describes the modes in which a file can be opened. | 8 * FileMode describes the modes in which a file can be opened. |
| 9 */ | 9 */ |
| 10 class FileMode { | 10 class FileMode { |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 * RandomAccessFile when the flush operation completes. | 421 * RandomAccessFile when the flush operation completes. |
| 422 */ | 422 */ |
| 423 Future<RandomAccessFile> flush(); | 423 Future<RandomAccessFile> flush(); |
| 424 | 424 |
| 425 /** | 425 /** |
| 426 * Synchronously flush the contents of the file to disk. | 426 * Synchronously flush the contents of the file to disk. |
| 427 */ | 427 */ |
| 428 void flushSync(); | 428 void flushSync(); |
| 429 | 429 |
| 430 /** | 430 /** |
| 431 * Returns a human readable string for this File instance. |
| 432 */ |
| 433 String toString(); |
| 434 |
| 435 /** |
| 431 * Get the name of the file. | 436 * Get the name of the file. |
| 432 */ | 437 */ |
| 433 String get name; | 438 String get name; |
| 434 } | 439 } |
| 435 | 440 |
| 436 | 441 |
| 437 class FileIOException implements Exception { | 442 class FileIOException implements Exception { |
| 438 const FileIOException([String this.message = "", | 443 const FileIOException([String this.message = "", |
| 439 OSError this.osError = null]); | 444 OSError this.osError = null]); |
| 440 String toString() { | 445 String toString() { |
| 441 StringBuffer sb = new StringBuffer(); | 446 StringBuffer sb = new StringBuffer(); |
| 442 sb.add("FileIOException"); | 447 sb.add("FileIOException"); |
| 443 if (!message.isEmpty) { | 448 if (!message.isEmpty) { |
| 444 sb.add(": $message"); | 449 sb.add(": $message"); |
| 445 if (osError != null) { | 450 if (osError != null) { |
| 446 sb.add(" ($osError)"); | 451 sb.add(" ($osError)"); |
| 447 } | 452 } |
| 448 } else if (osError != null) { | 453 } else if (osError != null) { |
| 449 sb.add(": osError"); | 454 sb.add(": osError"); |
| 450 } | 455 } |
| 451 return sb.toString(); | 456 return sb.toString(); |
| 452 } | 457 } |
| 453 final String message; | 458 final String message; |
| 454 final OSError osError; | 459 final OSError osError; |
| 455 } | 460 } |
| OLD | NEW |