Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Unified Diff: sdk/lib/io/file_system_entity.dart

Issue 39613002: Close file watcher when target is deleted. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't always emit delete, and fix docs. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file_system_watcher_linux.cc ('k') | tests/standalone/io/file_system_watcher_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/file_system_entity.dart
diff --git a/sdk/lib/io/file_system_entity.dart b/sdk/lib/io/file_system_entity.dart
index fa5395e768997a75889ca9e45a251667bb4cc050..e930a3594d05f15cc41d1ac7099f01370eef89c0 100644
--- a/sdk/lib/io/file_system_entity.dart
+++ b/sdk/lib/io/file_system_entity.dart
@@ -353,8 +353,13 @@ abstract class FileSystemEntity {
* files and directories. Recursive watching is supported.
*
* The system will start listening for events once the returned [Stream] is
- * being listened to, not when the call to [watch] is issued. Note that the
- * returned [Stream] is endless. To stop the [Stream], cancel the subscription.
+ * being listened to, not when the call to [watch] is issued.
+ *
+ * Note that the returned [Stream] is endless, unless:
+ *
+ * * The [Stream] is canceled, e.g. by calling `cancel` on the
+ * [StreamSubscription].
+ * * The [FileSystemEntity] being watches, is deleted.
*/
Stream<FileSystemEvent> watch({int events: FileSystemEvent.ALL,
bool recursive: false})
@@ -623,6 +628,7 @@ class FileSystemEvent {
static const int ALL = CREATE | MODIFY | DELETE | MOVE;
static const int _MODIFY_ATTRIBUTES = 1 << 4;
+ static const int _DELETE_SELF = 1 << 5;
/**
* The type of event. See [FileSystemEvent] for a list of events.
« no previous file with comments | « runtime/bin/file_system_watcher_linux.cc ('k') | tests/standalone/io/file_system_watcher_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698