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

Unified Diff: runtime/bin/file_system_watcher_macos.cc

Issue 46183007: Fix move-watched-dir for MacOS. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_system_watcher_macos.cc
diff --git a/runtime/bin/file_system_watcher_macos.cc b/runtime/bin/file_system_watcher_macos.cc
index 65ad6e9957dead2456acd0c0b9729794ce3e87cb..77fb6a9f20fa7639044e238ad50ca64d5e4aa9b1 100644
--- a/runtime/bin/file_system_watcher_macos.cc
+++ b/runtime/bin/file_system_watcher_macos.cc
@@ -267,8 +267,15 @@ Dart_Handle FileSystemWatcher::ReadEvents(intptr_t id) {
Dart_Handle event = Dart_NewList(4);
int flags = e.data.flags;
int mask = 0;
+ if (flags & kFSEventStreamEventFlagItemRenamed) {
+ if (path_len == 0) {
+ // The moved path is the path being watched.
+ mask |= kDeleteSelf;
+ } else {
+ mask |= kMove;
+ }
+ }
if (flags & kFSEventStreamEventFlagItemModified) mask |= kModifyContent;
- if (flags & kFSEventStreamEventFlagItemRenamed) mask |= kMove;
if (flags & kFSEventStreamEventFlagItemXattrMod) mask |= kModefyAttribute;
if (flags & kFSEventStreamEventFlagItemCreated) mask |= kCreate;
if (flags & kFSEventStreamEventFlagItemIsDir) mask |= kIsDir;
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698