| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 * Synchronously renames this file. Returns a [File] | 73 * Synchronously renames this file. Returns a [File] |
| 74 * instance for the renamed file. | 74 * instance for the renamed file. |
| 75 * | 75 * |
| 76 * If [newPath] identifies an existing file, that file is | 76 * If [newPath] identifies an existing file, that file is |
| 77 * replaced. If [newPath] identifies an existing directory the | 77 * replaced. If [newPath] identifies an existing directory the |
| 78 * operation fails and an exception is thrown. | 78 * operation fails and an exception is thrown. |
| 79 */ | 79 */ |
| 80 File renameSync(String newPath); | 80 File renameSync(String newPath); |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * Get a [Directory] object for the directory containing this | |
| 84 * file. Deprecated: Replaced by [FileSystemEntity.parent]. | |
| 85 * Will be removed on Oct 25, 2013. | |
| 86 */ | |
| 87 @deprecated | |
| 88 Directory get directory; | |
| 89 | |
| 90 /** | |
| 91 * Get the length of the file. Returns a [:Future<int>:] that | 83 * Get the length of the file. Returns a [:Future<int>:] that |
| 92 * completes with the length in bytes. | 84 * completes with the length in bytes. |
| 93 */ | 85 */ |
| 94 Future<int> length(); | 86 Future<int> length(); |
| 95 | 87 |
| 96 /** | 88 /** |
| 97 * Synchronously get the length of the file. | 89 * Synchronously get the length of the file. |
| 98 * | 90 * |
| 99 * Throws a [FileSystemException] if the operation fails. | 91 * Throws a [FileSystemException] if the operation fails. |
| 100 */ | 92 */ |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 * can be performed. Opened [RandomAccessFile]s must be closed using | 141 * can be performed. Opened [RandomAccessFile]s must be closed using |
| 150 * the [RandomAccessFile.close] method. | 142 * the [RandomAccessFile.close] method. |
| 151 * | 143 * |
| 152 * See [open] for information on the [mode] argument. | 144 * See [open] for information on the [mode] argument. |
| 153 * | 145 * |
| 154 * Throws a [FileSystemException] if the operation fails. | 146 * Throws a [FileSystemException] if the operation fails. |
| 155 */ | 147 */ |
| 156 RandomAccessFile openSync({FileMode mode: FileMode.READ}); | 148 RandomAccessFile openSync({FileMode mode: FileMode.READ}); |
| 157 | 149 |
| 158 /** | 150 /** |
| 159 * Get the canonical full path corresponding to the file path. | |
| 160 * Returns a [:Future<String>:] that completes with the path. | |
| 161 * | |
| 162 * *FullPath is deprecated. Use absolutePath or resolveSymbolicLinks | |
| 163 * instead. FullPath will be removed the 23rd of September, 2013.* | |
| 164 */ | |
| 165 @deprecated | |
| 166 Future<String> fullPath(); | |
| 167 | |
| 168 /** | |
| 169 * Synchronously get the canonical full path corresponding to the file path. | |
| 170 * | |
| 171 * Throws a [FileSystemException] if the operation fails. | |
| 172 * | |
| 173 * *FullPathSync is deprecated. Use absolutePathSync or | |
| 174 * resolveSymbolicLinksSync instead. FullPathSync will be removed | |
| 175 * the 23rd of September, 2013.* | |
| 176 */ | |
| 177 @deprecated | |
| 178 String fullPathSync(); | |
| 179 | |
| 180 /** | |
| 181 * Create a new independent [Stream] for the contents of this file. | 151 * Create a new independent [Stream] for the contents of this file. |
| 182 * | 152 * |
| 183 * If [start] is present, the file will be read from byte-offset [start]. | 153 * If [start] is present, the file will be read from byte-offset [start]. |
| 184 * Otherwise from the beginning (index 0). | 154 * Otherwise from the beginning (index 0). |
| 185 * | 155 * |
| 186 * If [end] is present, only up to byte-index [end] will be read. Otherwise, | 156 * If [end] is present, only up to byte-index [end] will be read. Otherwise, |
| 187 * until end of file. | 157 * until end of file. |
| 188 * | 158 * |
| 189 * In order to make sure that system resources are freed, the stream | 159 * In order to make sure that system resources are freed, the stream |
| 190 * must be read to completion or the subscription on the stream must | 160 * must be read to completion or the subscription on the stream must |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 515 } |
| 546 } else if (osError != null) { | 516 } else if (osError != null) { |
| 547 sb.write(": osError"); | 517 sb.write(": osError"); |
| 548 if (path != null) { | 518 if (path != null) { |
| 549 sb.write(", path = $path"); | 519 sb.write(", path = $path"); |
| 550 } | 520 } |
| 551 } | 521 } |
| 552 return sb.toString(); | 522 return sb.toString(); |
| 553 } | 523 } |
| 554 } | 524 } |
| OLD | NEW |