| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 * [Directory] objects are used for working with directories. | 8 * [Directory] objects are used for working with directories. |
| 9 */ | 9 */ |
| 10 abstract class Directory extends FileSystemEntity { | 10 abstract class Directory extends FileSystemEntity { |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 * If newPath identifies an existing directory, that directory is | 127 * If newPath identifies an existing directory, that directory is |
| 128 * replaced. If newPath identifies an existing file the operation | 128 * replaced. If newPath identifies an existing file the operation |
| 129 * fails and an exception is thrown. | 129 * fails and an exception is thrown. |
| 130 */ | 130 */ |
| 131 Directory renameSync(String newPath); | 131 Directory renameSync(String newPath); |
| 132 | 132 |
| 133 /** | 133 /** |
| 134 * Lists the sub-directories and files of this [Directory]. | 134 * Lists the sub-directories and files of this [Directory]. |
| 135 * Optionally recurses into sub-directories. | 135 * Optionally recurses into sub-directories. |
| 136 * | 136 * |
| 137 * If [followLinks] is false, then any symbolic links found |
| 138 * are reported as links, rather than as directories or files, |
| 139 * and are not recursed into. |
| 140 * |
| 137 * The result is a stream of [FileSystemEntity] objects | 141 * The result is a stream of [FileSystemEntity] objects |
| 138 * for the directories and files. | 142 * for the directories, files, and links. |
| 139 */ | 143 */ |
| 140 Stream<FileSystemEntity> list({bool recursive: false}); | 144 Stream<FileSystemEntity> list({bool recursive: false, |
| 145 bool followLinks: true}); |
| 141 | 146 |
| 142 /** | 147 /** |
| 143 * Lists the sub-directories and files of this [Directory]. | 148 * Lists the sub-directories and files of this [Directory]. |
| 144 * Optionally recurses into sub-directories. | 149 * Optionally recurses into sub-directories. |
| 145 * | 150 * |
| 151 * If [followLinks] is false, then any symbolic links found |
| 152 * are reported as links, rather than as directories or files, |
| 153 * and are not recursed into. |
| 154 * |
| 146 * Returns a [List] containing [FileSystemEntity] objects for the | 155 * Returns a [List] containing [FileSystemEntity] objects for the |
| 147 * directories and files. | 156 * directories, files, and links. |
| 148 */ | 157 */ |
| 149 List<FileSystemEntity> listSync({bool recursive: false}); | 158 List<FileSystemEntity> listSync({bool recursive: false, |
| 159 bool followLinks: true}); |
| 150 | 160 |
| 151 /** | 161 /** |
| 152 * Returns a human readable string for this Directory instance. | 162 * Returns a human readable string for this Directory instance. |
| 153 */ | 163 */ |
| 154 String toString(); | 164 String toString(); |
| 155 | 165 |
| 156 /** | 166 /** |
| 157 * Gets the path of this directory. | 167 * Gets the path of this directory. |
| 158 */ | 168 */ |
| 159 final String path; | 169 final String path; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 180 if (path != null) { | 190 if (path != null) { |
| 181 sb.write(", path = $path"); | 191 sb.write(", path = $path"); |
| 182 } | 192 } |
| 183 } | 193 } |
| 184 return sb.toString(); | 194 return sb.toString(); |
| 185 } | 195 } |
| 186 final String message; | 196 final String message; |
| 187 final String path; | 197 final String path; |
| 188 final OSError osError; | 198 final OSError osError; |
| 189 } | 199 } |
| OLD | NEW |