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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 * Lists the sub-directories and files of this [Directory]. | 145 * Lists the sub-directories and files of this [Directory]. |
146 * Optionally recurses into sub-directories. | 146 * Optionally recurses into sub-directories. |
147 * | 147 * |
148 * If [followLinks] is false, then any symbolic links found | 148 * If [followLinks] is false, then any symbolic links found |
149 * are reported as [Link] objects, rather than as directories or files, | 149 * are reported as [Link] objects, rather than as directories or files, |
150 * and are not recursed into. | 150 * and are not recursed into. |
151 * | 151 * |
152 * If [followLinks] is true, then working links are reported as | 152 * If [followLinks] is true, then working links are reported as |
153 * directories or files, depending on | 153 * directories or files, depending on |
154 * their type, and links to directories are recursed into. | 154 * their type, and links to directories are recursed into. |
155 * Broken links are reported as [Link] objects, | 155 * Broken links are reported as [Link] objects. |
| 156 * If a symbolic link makes a loop in the file system, then a recursive |
| 157 * listing will not follow a link twice in the |
| 158 * same recursive descent, but will report it as a [Link] |
| 159 * the second time it is seen. |
156 * | 160 * |
157 * The result is a stream of [FileSystemEntity] objects | 161 * The result is a stream of [FileSystemEntity] objects |
158 * for the directories, files, and links. | 162 * for the directories, files, and links. |
159 */ | 163 */ |
160 Stream<FileSystemEntity> list({bool recursive: false, | 164 Stream<FileSystemEntity> list({bool recursive: false, |
161 bool followLinks: true}); | 165 bool followLinks: true}); |
162 | 166 |
163 /** | 167 /** |
164 * Lists the sub-directories and files of this [Directory]. | 168 * Lists the sub-directories and files of this [Directory]. |
165 * Optionally recurses into sub-directories. | 169 * Optionally recurses into sub-directories. |
166 * | 170 * |
167 * If [followLinks] is false, then any symbolic links found | 171 * If [followLinks] is false, then any symbolic links found |
168 * are reported as [Link] objects, rather than as directories or files, | 172 * are reported as [Link] objects, rather than as directories or files, |
169 * and are not recursed into. | 173 * and are not recursed into. |
170 * | 174 * |
171 * If [followLinks] is true, then working links are reported as | 175 * If [followLinks] is true, then working links are reported as |
172 * directories or files, depending on | 176 * directories or files, depending on |
173 * their type, and links to directories are recursed into. | 177 * their type, and links to directories are recursed into. |
174 * Broken links are reported as [Link] objects, | 178 * Broken links are reported as [Link] objects. |
| 179 * If a link makes a loop in the file system, then a recursive |
| 180 * listing will not follow a link twice in the |
| 181 * same recursive descent, but will report it as a [Link] |
| 182 * the second time it is seen. |
175 * | 183 * |
176 * Returns a [List] containing [FileSystemEntity] objects for the | 184 * Returns a [List] containing [FileSystemEntity] objects for the |
177 * directories, files, and links. | 185 * directories, files, and links. |
178 */ | 186 */ |
179 List<FileSystemEntity> listSync({bool recursive: false, | 187 List<FileSystemEntity> listSync({bool recursive: false, |
180 bool followLinks: true}); | 188 bool followLinks: true}); |
181 | 189 |
182 /** | 190 /** |
183 * Returns a human readable string for this Directory instance. | 191 * Returns a human readable string for this Directory instance. |
184 */ | 192 */ |
(...skipping 26 matching lines...) Expand all Loading... |
211 if (path != null) { | 219 if (path != null) { |
212 sb.write(", path = $path"); | 220 sb.write(", path = $path"); |
213 } | 221 } |
214 } | 222 } |
215 return sb.toString(); | 223 return sb.toString(); |
216 } | 224 } |
217 final String message; | 225 final String message; |
218 final String path; | 226 final String path; |
219 final OSError osError; | 227 final OSError osError; |
220 } | 228 } |
OLD | NEW |