| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 /** | 53 /** |
| 54 * Synchronously create the file. Existing files are left untouched | 54 * Synchronously create the file. Existing files are left untouched |
| 55 * by [createSync]. Calling [createSync] on an existing file might fail | 55 * by [createSync]. Calling [createSync] on an existing file might fail |
| 56 * if there are restrictive permissions on the file. | 56 * if there are restrictive permissions on the file. |
| 57 * | 57 * |
| 58 * Throws a [FileException] if the operation fails. | 58 * Throws a [FileException] if the operation fails. |
| 59 */ | 59 */ |
| 60 void createSync(); | 60 void createSync(); |
| 61 | 61 |
| 62 /** | 62 /** |
| 63 * Delete the file. Returns a [:Future<File>:] that completes with | |
| 64 * the file when it has been deleted. Only a file or a link to a file | |
| 65 * can be deleted with this method, not a directory or a broken link. | |
| 66 */ | |
| 67 Future<File> delete(); | |
| 68 | |
| 69 /** | |
| 70 * Synchronously delete the file. Only a file or a link to a file | |
| 71 * can be deleted with this method, not a directory or a broken link. | |
| 72 * | |
| 73 * Throws a [FileException] if the operation fails. | |
| 74 */ | |
| 75 void deleteSync(); | |
| 76 | |
| 77 /** | |
| 78 * Renames this file. Returns a `Future<File>` that completes | 63 * Renames this file. Returns a `Future<File>` that completes |
| 79 * with a [File] instance for the renamed file. | 64 * with a [File] instance for the renamed file. |
| 80 * | 65 * |
| 81 * If [newPath] identifies an existing file, that file is | 66 * If [newPath] identifies an existing file, that file is |
| 82 * replaced. If [newPath] identifies an existing directory, the | 67 * replaced. If [newPath] identifies an existing directory, the |
| 83 * operation fails and the future completes with an exception. | 68 * operation fails and the future completes with an exception. |
| 84 */ | 69 */ |
| 85 Future<File> rename(String newPath); | 70 Future<File> rename(String newPath); |
| 86 | 71 |
| 87 /** | 72 /** |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 } | 525 } |
| 541 } else if (osError != null) { | 526 } else if (osError != null) { |
| 542 sb.write(": osError"); | 527 sb.write(": osError"); |
| 543 if (path != null) { | 528 if (path != null) { |
| 544 sb.write(", path = $path"); | 529 sb.write(", path = $path"); |
| 545 } | 530 } |
| 546 } | 531 } |
| 547 return sb.toString(); | 532 return sb.toString(); |
| 548 } | 533 } |
| 549 } | 534 } |
| OLD | NEW |