| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 interface Directory factory _Directory { | 5 interface Directory factory _Directory { |
| 6 /** | 6 /** |
| 7 * Creates a directory object. The path is either a full path or | 7 * Creates a directory object. The path is either a full path or |
| 8 * relative to the directory in which the Dart VM was | 8 * relative to the directory in which the Dart VM was |
| 9 * started. | 9 * started. |
| 10 */ | 10 */ |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * path is the empty string, a default system temp directory and name | 28 * path is the empty string, a default system temp directory and name |
| 29 * are used for the template. | 29 * are used for the template. |
| 30 * The path is modified to be the path of the new directory. | 30 * The path is modified to be the path of the new directory. |
| 31 * After the new directory is created, and the path modified, the callback | 31 * After the new directory is created, and the path modified, the callback |
| 32 * createTempHandler will be called. The error handler is called if | 32 * createTempHandler will be called. The error handler is called if |
| 33 * the temporary directory cannot be created. | 33 * the temporary directory cannot be created. |
| 34 */ | 34 */ |
| 35 void createTemp(); | 35 void createTemp(); |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * Synchronously creates a temporary directory with a name based on the curren
t path. |
| 39 * This name and path is used as a template, and additional characters are |
| 40 * appended to it by the call to make a unique directory name. If the |
| 41 * path is the empty string, a default system temp directory and name |
| 42 * are used for the template. |
| 43 * The path is modified to be the path of the new directory. |
| 44 */ |
| 45 void createTempSync(); |
| 46 |
| 47 /** |
| 38 * Deletes the directory with this name. Throws an exception | 48 * Deletes the directory with this name. Throws an exception |
| 39 * if the directory is not empty or if deletion failed. | 49 * if the directory is not empty or if deletion failed. |
| 40 */ | 50 */ |
| 41 void deleteSync(); | 51 void deleteSync(); |
| 42 | 52 |
| 43 /** | 53 /** |
| 44 * List the sub-directories and files of this | 54 * List the sub-directories and files of this |
| 45 * [Directory]. Optionally recurse into sub-directories. For each | 55 * [Directory]. Optionally recurse into sub-directories. For each |
| 46 * file and directory, the file or directory handler is called. When | 56 * file and directory, the file or directory handler is called. When |
| 47 * all directories have been listed the done handler is called. If | 57 * all directories have been listed the done handler is called. If |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 */ | 98 */ |
| 89 final String path; | 99 final String path; |
| 90 } | 100 } |
| 91 | 101 |
| 92 | 102 |
| 93 class DirectoryException { | 103 class DirectoryException { |
| 94 const DirectoryException(String this.message); | 104 const DirectoryException(String this.message); |
| 95 String toString() => "DirectoryException: $message"; | 105 String toString() => "DirectoryException: $message"; |
| 96 final String message; | 106 final String message; |
| 97 } | 107 } |
| OLD | NEW |