| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 * The returned value is an endless broadcast [Stream], that only stops when | 411 * The returned value is an endless broadcast [Stream], that only stops when |
| 412 * one of the following happends: | 412 * one of the following happends: |
| 413 * | 413 * |
| 414 * * The [Stream] is canceled, e.g. by calling `cancel` on the | 414 * * The [Stream] is canceled, e.g. by calling `cancel` on the |
| 415 * [StreamSubscription]. | 415 * [StreamSubscription]. |
| 416 * * The [FileSystemEntity] being watches, is deleted. | 416 * * The [FileSystemEntity] being watches, is deleted. |
| 417 * | 417 * |
| 418 * Use `events` to specify what events to listen for. The constants in | 418 * Use `events` to specify what events to listen for. The constants in |
| 419 * [FileSystemEvent] can be or'ed together to mix events. Default is | 419 * [FileSystemEvent] can be or'ed together to mix events. Default is |
| 420 * [FileSystemEvent.ALL]. | 420 * [FileSystemEvent.ALL]. |
| 421 * |
| 422 * A move event may be reported as seperate delete and create events. |
| 421 */ | 423 */ |
| 422 Stream<FileSystemEvent> watch({int events: FileSystemEvent.ALL, | 424 Stream<FileSystemEvent> watch({int events: FileSystemEvent.ALL, |
| 423 bool recursive: false}) | 425 bool recursive: false}) |
| 424 => _FileSystemWatcher.watch(_trimTrailingPathSeparators(path), | 426 => _FileSystemWatcher.watch(_trimTrailingPathSeparators(path), |
| 425 events, | 427 events, |
| 426 recursive); | 428 recursive); |
| 427 | 429 |
| 428 Future<FileSystemEntity> _delete({bool recursive: false}); | 430 Future<FileSystemEntity> _delete({bool recursive: false}); |
| 429 void _deleteSync({bool recursive: false}); | 431 void _deleteSync({bool recursive: false}); |
| 430 | 432 |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 return buffer.toString(); | 808 return buffer.toString(); |
| 807 } | 809 } |
| 808 } | 810 } |
| 809 | 811 |
| 810 | 812 |
| 811 class _FileSystemWatcher { | 813 class _FileSystemWatcher { |
| 812 external static Stream<FileSystemEvent> watch( | 814 external static Stream<FileSystemEvent> watch( |
| 813 String path, int events, bool recursive); | 815 String path, int events, bool recursive); |
| 814 external static bool get isSupported; | 816 external static bool get isSupported; |
| 815 } | 817 } |
| OLD | NEW |