| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 */ | 76 */ |
| 77 void directory(void callback(Directory dir)); | 77 void directory(void callback(Directory dir)); |
| 78 | 78 |
| 79 /** | 79 /** |
| 80 * Synchronously get a Directory object for the directory containing | 80 * Synchronously get a Directory object for the directory containing |
| 81 * this file. | 81 * this file. |
| 82 */ | 82 */ |
| 83 Directory directorySync(); | 83 Directory directorySync(); |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * Get the length of the file. When the operation completes the |
| 87 * callback is called with the length. |
| 88 */ |
| 89 void length(void callback(int length)); |
| 90 |
| 91 /** |
| 92 * Synchronously get the length of the file. |
| 93 */ |
| 94 int lengthSync(); |
| 95 |
| 96 /** |
| 86 * Open the file for random access operations. When the file is | 97 * Open the file for random access operations. When the file is |
| 87 * opened the callback is called with the resulting | 98 * opened the callback is called with the resulting |
| 88 * RandomAccessFile. RandomAccessFiles must be closed using the | 99 * RandomAccessFile. RandomAccessFiles must be closed using the |
| 89 * [close] method. If the file cannot be opened [onError] is called. | 100 * [close] method. If the file cannot be opened [onError] is called. |
| 90 * | 101 * |
| 91 * Files can be opened in three modes: | 102 * Files can be opened in three modes: |
| 92 * | 103 * |
| 93 * FileMode.READ: open the file for reading. If the file does not | 104 * FileMode.READ: open the file for reading. If the file does not |
| 94 * exist [onError] is called. | 105 * exist [onError] is called. |
| 95 * | 106 * |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 sb.add(" ($osError)"); | 390 sb.add(" ($osError)"); |
| 380 } | 391 } |
| 381 } else if (osError != null) { | 392 } else if (osError != null) { |
| 382 sb.add(": osError"); | 393 sb.add(": osError"); |
| 383 } | 394 } |
| 384 return sb.toString(); | 395 return sb.toString(); |
| 385 } | 396 } |
| 386 final String message; | 397 final String message; |
| 387 final OSError osError; | 398 final OSError osError; |
| 388 } | 399 } |
| OLD | NEW |