malthe/macfsevents — Issue #7: unchanged subdirectories get flagged as "created" (mask 256)
Author: aaulich
Created: 2012-02-20 15:37:44+00:00
State: open

When I watch a folder with subdirectories inside it and then
create a new subdirectory or file inside the watched folder,
all the other, already existing but still unchanged subdirectories
get the fsevent mask 256, which means created.

E.g. if this is the folder I watch, incl. subdirs:

test -- subdir1
-- subdir2
-- subdir3

Then I copy the file 1.png into the test folder:

test -- 1.png
-- subdir1
-- subdir2
-- subdir3

The events I receive, now, are:
---------------
file name: /test/1.png
Mask: 256, Cookie: None
---------------
file name: /test/subdir2
Mask: 256, Cookie: None
---------------
file name: /test/subdir3
Mask: 256, Cookie: None
---------------
file name: /test/test/subdir1
Mask: 256, Cookie: None

This happens only the first time I copy something into a folder
after I start the module.

To me it looks as if the tool does the following:

The first time I copy something into a folder, it lists its
contents and keeps a reflection of that in memory.

As macfsevents doesn't know what the directory listing looked
like before the initial event, it marks all contained folders as
created (256). If there are files inside a folder, they only receive
an event if they are really changed.

Is this something that happens within macfsevents, or is this
something that happens on the Apple OS filesystem level?