on master help sign in
Update documentation
6831129Harendra Kumar
src/Streamly/Internal/FileSystem/Event/Darwin.hs+28−15
@@ -32,20 +32,32 @@
32--
32--
33-- =BUGS
33-- =BUGS
34--
34--
35−-- There may be some idiosyncracies in event reporting likely due to temporal
35+-- There may be some idiosyncrasies in event reporting.
36−-- coalescing of events by the macOS fs events implementation.
37−--
36+--
38−-- 1. Multiple events that happen in quick succession may be coalesced into a
37+-- 1. Multiple events may be coalesced into a single event having multiple
39−-- single event with multiple event flags set. We have observed that sometimes
40−-- "Deleted", "Renamed", "Modified" events have "Created" flag also present.
41−-- For example, on macOS 10.15.1, try "touch x; rm x" or "rm x; touch
38+-- flags set. For example, on macOS 10.15.6, "touch x; rm x" or "touch x; mv x
42−-- x" or "touch x; mv x y". Sometimes even just an "rm x" produces both flags.
39+-- y" produces an event with both "Created" and "Deleted/Moved" flags set.
43−-- 2. Sometimes it has been seen that the earlier events go missing and only
40+--
41+-- 2. The same event can occur multiple times. For example, "touch x; sleep 1;
42+-- rm x" generates a "Created" event followed by an event with both "Created"
43+-- and "Deleted" flags set. Similarly, a cloned event can also occur multiple
44+-- times.
45+--
46+-- 3. Some events can go missing and only the latest one is reported. See
44−-- the latest one is reported. See 'isCreated' for one such case.
47+-- 'isCreated' for one such case.
48+--
45−-- 3. When @rm -rf@ is used on the watched root directory, only one 'isDeleted'
49+-- 4. When @rm -rf@ is used on the watched root directory, only one 'isDeleted'
46-- event occurs and that is for the root. However, @rm -rf@ on a directory
50-- event occurs and that is for the root. However, @rm -rf@ on a directory
47-- inside the watch root produces 'isDeleted' events for all files.
51-- inside the watch root produces 'isDeleted' events for all files.
48--
52--
53+-- 5. When a file is moved, a move event occurs for both the source and the
54+-- destination files. There seems to be no way to distinguish the source and
55+-- the destination. Perhaps the lower eventId can be considered as source.
56+--
57+-- 6. When a file is cloned both source and destination generate a cloned
58+-- event, however the source has lower eventId and destination may have
59+-- OwnerGroupModeChanged, InodeAttrsChanged, Created flags as well.
60+--
49-- You may have to stat the path of the event to know more information about
61-- You may have to stat the path of the event to know more information about
50-- what might have happened. It may be a good idea to watch the behavior of
62-- what might have happened. It may be a good idea to watch the behavior of
51-- events you are handling before you can rely on it. See the individual event
63-- events you are handling before you can rely on it. See the individual event
@@ -789,9 +801,9 @@ foreign import ccall safe
789-- non-existing path and the path is created later, then this event is not
801-- non-existing path and the path is created later, then this event is not
790-- generated, the path is not watched.
802-- generated, the path is not watched.
791--
803--
792−-- BUGS: When we use a "touch x" to create a file for the first time only an
804+-- BUGS: On 10.15.1 when we use a "touch x" to create a file for the first time
793−-- 'isInodeAttrsChanged' event occurs and there is no 'isCreated' event (tested
805+-- only an 'isInodeAttrsChanged' event occurs and there is no 'isCreated'
794−-- on 10.15.1).
806+-- event. However, this seems to have been fixed on 10.15.6.
795--
807--
796-- /Applicable only when 'setFileEvents' is 'On'/
808-- /Applicable only when 'setFileEvents' is 'On'/
797--
809--
@@ -863,7 +875,8 @@ foreign import ccall safe
863 kFSEventStreamEventFlagItemCloned :: Word32
875 kFSEventStreamEventFlagItemCloned :: Word32
864
876
865-- | Determine whether the event indicates cloning of an object within the
877-- | Determine whether the event indicates cloning of an object within the
866−-- monitored path.
878+-- monitored path. The "Duplicate" command in the "File" menu of the "Finder"
879+-- application generates a "clone" event.
867--
880--
868-- Applicable only when 'setFileEvents' is 'On'.
881-- Applicable only when 'setFileEvents' is 'On'.
869--
882--