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 /** |
83 * Get the length of the file. Returns a [:Future<int>:] that | 91 * Get the length of the file. Returns a [:Future<int>:] that |
84 * completes with the length in bytes. | 92 * completes with the length in bytes. |
85 */ | 93 */ |
86 Future<int> length(); | 94 Future<int> length(); |
87 | 95 |
88 /** | 96 /** |
89 * Synchronously get the length of the file. | 97 * Synchronously get the length of the file. |
90 * | 98 * |
91 * Throws a [FileSystemException] if the operation fails. | 99 * Throws a [FileSystemException] if the operation fails. |
92 */ | 100 */ |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 * can be performed. Opened [RandomAccessFile]s must be closed using | 149 * can be performed. Opened [RandomAccessFile]s must be closed using |
142 * the [RandomAccessFile.close] method. | 150 * the [RandomAccessFile.close] method. |
143 * | 151 * |
144 * See [open] for information on the [mode] argument. | 152 * See [open] for information on the [mode] argument. |
145 * | 153 * |
146 * Throws a [FileSystemException] if the operation fails. | 154 * Throws a [FileSystemException] if the operation fails. |
147 */ | 155 */ |
148 RandomAccessFile openSync({FileMode mode: FileMode.READ}); | 156 RandomAccessFile openSync({FileMode mode: FileMode.READ}); |
149 | 157 |
150 /** | 158 /** |
| 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 /** |
151 * Create a new independent [Stream] for the contents of this file. | 181 * Create a new independent [Stream] for the contents of this file. |
152 * | 182 * |
153 * If [start] is present, the file will be read from byte-offset [start]. | 183 * If [start] is present, the file will be read from byte-offset [start]. |
154 * Otherwise from the beginning (index 0). | 184 * Otherwise from the beginning (index 0). |
155 * | 185 * |
156 * If [end] is present, only up to byte-index [end] will be read. Otherwise, | 186 * If [end] is present, only up to byte-index [end] will be read. Otherwise, |
157 * until end of file. | 187 * until end of file. |
158 * | 188 * |
159 * In order to make sure that system resources are freed, the stream | 189 * In order to make sure that system resources are freed, the stream |
160 * must be read to completion or the subscription on the stream must | 190 * 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... |
515 } | 545 } |
516 } else if (osError != null) { | 546 } else if (osError != null) { |
517 sb.write(": osError"); | 547 sb.write(": osError"); |
518 if (path != null) { | 548 if (path != null) { |
519 sb.write(", path = $path"); | 549 sb.write(", path = $path"); |
520 } | 550 } |
521 } | 551 } |
522 return sb.toString(); | 552 return sb.toString(); |
523 } | 553 } |
524 } | 554 } |
OLD | NEW |