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 * The type of an entity on the file system, such as a file, directory, or link. | 8 * The type of an entity on the file system, such as a file, directory, or link. |
9 * | 9 * |
10 * These constants are used by the [FileSystemEntity] class | 10 * These constants are used by the [FileSystemEntity] class |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 * Calls the operating system's stat() function on the [path] of this | 352 * Calls the operating system's stat() function on the [path] of this |
353 * [FileSystemEntity]. Identical to [:FileStat.stat(this.path):]. | 353 * [FileSystemEntity]. Identical to [:FileStat.stat(this.path):]. |
354 * | 354 * |
355 * Returns a [:Future<FileStat>:] object containing the data returned by | 355 * Returns a [:Future<FileStat>:] object containing the data returned by |
356 * stat(). | 356 * stat(). |
357 * | 357 * |
358 * If the call fails, completes the future with a [FileStat] object | 358 * If the call fails, completes the future with a [FileStat] object |
359 * with .type set to | 359 * with .type set to |
360 * FileSystemEntityType.NOT_FOUND and the other fields invalid. | 360 * FileSystemEntityType.NOT_FOUND and the other fields invalid. |
361 */ | 361 */ |
362 Future<FileStat> stat(); | 362 Future<FileStat> stat() => FileStat.stat(path); |
363 | 363 |
364 /** | 364 /** |
365 * Synchronously calls the operating system's stat() function on the | 365 * Synchronously calls the operating system's stat() function on the |
366 * [path] of this [FileSystemEntity]. | 366 * [path] of this [FileSystemEntity]. |
367 * Identical to [:FileStat.statSync(this.path):]. | 367 * Identical to [:FileStat.statSync(this.path):]. |
368 * | 368 * |
369 * Returns a [FileStat] object containing the data returned by stat(). | 369 * Returns a [FileStat] object containing the data returned by stat(). |
370 * | 370 * |
371 * If the call fails, returns a [FileStat] object with .type set to | 371 * If the call fails, returns a [FileStat] object with .type set to |
372 * FileSystemEntityType.NOT_FOUND and the other fields invalid. | 372 * FileSystemEntityType.NOT_FOUND and the other fields invalid. |
373 */ | 373 */ |
374 FileStat statSync(); | 374 FileStat statSync() => FileStat.statSync(path); |
375 | 375 |
376 /** | 376 /** |
377 * Deletes this [FileSystemEntity]. | 377 * Deletes this [FileSystemEntity]. |
378 * | 378 * |
379 * If the [FileSystemEntity] is a directory, and if [recursive] is false, | 379 * If the [FileSystemEntity] is a directory, and if [recursive] is false, |
380 * the directory must be empty. Otherwise, if [recursive] is true, the | 380 * the directory must be empty. Otherwise, if [recursive] is true, the |
381 * directory and all sub-directories and files in the directories are | 381 * directory and all sub-directories and files in the directories are |
382 * deleted. Links are not followed when deleting recursively. Only the link | 382 * deleted. Links are not followed when deleting recursively. Only the link |
383 * is deleted, not its target. | 383 * is deleted, not its target. |
384 * | 384 * |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 return buffer.toString(); | 831 return buffer.toString(); |
832 } | 832 } |
833 } | 833 } |
834 | 834 |
835 | 835 |
836 class _FileSystemWatcher { | 836 class _FileSystemWatcher { |
837 external static Stream<FileSystemEvent> _watch( | 837 external static Stream<FileSystemEvent> _watch( |
838 String path, int events, bool recursive); | 838 String path, int events, bool recursive); |
839 external static bool get isSupported; | 839 external static bool get isSupported; |
840 } | 840 } |
OLD | NEW |