| 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 int lengthSync(); | 92 int lengthSync(); |
| 93 | 93 |
| 94 /** | 94 /** |
| 95 * Open the file for random access operations. Returns a | 95 * Open the file for random access operations. Returns a |
| 96 * [:Future<RandomAccessFile>:] that completes with the opened | 96 * [:Future<RandomAccessFile>:] that completes with the opened |
| 97 * random access file. RandomAccessFiles must be closed using the | 97 * random access file. RandomAccessFiles must be closed using the |
| 98 * [close] method. | 98 * [close] method. |
| 99 * | 99 * |
| 100 * Files can be opened in three modes: | 100 * Files can be opened in three modes: |
| 101 * | 101 * |
| 102 * FileMode.READ: open the file for reading. If the file does not | 102 * FileMode.READ: open the file for reading. |
| 103 * exist [onError] is called. | |
| 104 * | 103 * |
| 105 * FileMode.WRITE: open the file for both reading and writing and | 104 * FileMode.WRITE: open the file for both reading and writing and |
| 106 * truncate the file to length zero. If the file does not exist the | 105 * truncate the file to length zero. If the file does not exist the |
| 107 * file is created. | 106 * file is created. |
| 108 * | 107 * |
| 109 * FileMode.APPEND: same as FileMode.WRITE except that the file is | 108 * FileMode.APPEND: same as FileMode.WRITE except that the file is |
| 110 * not truncated. | 109 * not truncated. |
| 111 * | 110 * |
| 112 * The default value for [mode] is [:FileMode.READ:]. | 111 * The default value for [mode] is [:FileMode.READ:]. |
| 113 */ | 112 */ |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 sb.add(" ($osError)"); | 368 sb.add(" ($osError)"); |
| 370 } | 369 } |
| 371 } else if (osError != null) { | 370 } else if (osError != null) { |
| 372 sb.add(": osError"); | 371 sb.add(": osError"); |
| 373 } | 372 } |
| 374 return sb.toString(); | 373 return sb.toString(); |
| 375 } | 374 } |
| 376 final String message; | 375 final String message; |
| 377 final OSError osError; | 376 final OSError osError; |
| 378 } | 377 } |
| OLD | NEW |