Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 Future<String> fullPath(); | 173 Future<String> fullPath(); |
| 174 | 174 |
| 175 /** | 175 /** |
| 176 * Synchronously get the canonical full path corresponding to the file path. | 176 * Synchronously get the canonical full path corresponding to the file path. |
| 177 * | 177 * |
| 178 * Throws a [FileIOException] if the operation fails. | 178 * Throws a [FileIOException] if the operation fails. |
| 179 */ | 179 */ |
| 180 String fullPathSync(); | 180 String fullPathSync(); |
| 181 | 181 |
| 182 /** | 182 /** |
| 183 * Create a new independent [Stream](../dart_async/Stream.html) for the | 183 * Create a new independent [Stream](../dart_async/Stream.html) for the |
|
Søren Gjesse
2013/05/21 09:06:04
Remove the reference ../dart_async/Stream.html.
Anders Johnsen
2013/05/21 09:22:11
Done.
| |
| 184 * contents of this file. | 184 * contents of this file. |
| 185 * | 185 * |
|
Søren Gjesse
2013/05/21 09:06:04
Move this part below the description of the argume
Anders Johnsen
2013/05/21 09:22:11
Done.
| |
| 186 * In order to make sure that system resources are freed, the stream | 186 * In order to make sure that system resources are freed, the stream |
| 187 * must be read to completion or the subscription on the stream must | 187 * must be read to completion or the subscription on the stream must |
| 188 * be cancelled. | 188 * be cancelled. |
| 189 * | |
| 190 * If [start] is present, the file will be read from byte-offset [start]. | |
|
Søren Gjesse
2013/05/21 09:06:04
add (index 0) after beginning.
Anders Johnsen
2013/05/21 09:22:11
Done.
| |
| 191 * Otherwise from the beginning. | |
| 192 * | |
| 193 * If [end] is present, only up to byte-index [end] will be read. Otherwise, | |
| 194 * until end of file. | |
| 189 */ | 195 */ |
| 190 Stream<List<int>> openRead(); | 196 Stream<List<int>> openRead([int start, int end]); |
| 191 | 197 |
| 192 /** | 198 /** |
| 193 * Creates a new independent [IOSink] for the file. The | 199 * Creates a new independent [IOSink] for the file. The |
| 194 * [IOSink] must be closed when no longer used, to free | 200 * [IOSink] must be closed when no longer used, to free |
| 195 * system resources. | 201 * system resources. |
| 196 * | 202 * |
| 197 * An [IOSink] for a file can be opened in two modes: | 203 * An [IOSink] for a file can be opened in two modes: |
| 198 * | 204 * |
| 199 * * [FileMode.WRITE]: truncates the file to length zero. | 205 * * [FileMode.WRITE]: truncates the file to length zero. |
| 200 * * [FileMode.APPEND]: sets the initial write position to the end | 206 * * [FileMode.APPEND]: sets the initial write position to the end |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 533 sb.write(" ($osError)"); | 539 sb.write(" ($osError)"); |
| 534 } | 540 } |
| 535 } else if (osError != null) { | 541 } else if (osError != null) { |
| 536 sb.write(": osError"); | 542 sb.write(": osError"); |
| 537 } | 543 } |
| 538 return sb.toString(); | 544 return sb.toString(); |
| 539 } | 545 } |
| 540 final String message; | 546 final String message; |
| 541 final OSError osError; | 547 final OSError osError; |
| 542 } | 548 } |
| OLD | NEW |