I am trying to write something using kqueue to monitor a directory. It is my 
understanding that for file creation I will be told a directory has been 
written to and I then have to list the directory myself to determine the file 
added.

I add the original directory path files using 
enumeratorAtURL:includingPropertiesForKeys:options:errorHandler: which I gather 
is the preferred deep, subdirectories included, lister choice.
This seems to have an option to omit hidden files. I am not using it but  still 
do not seem to get .DS_Store

When I receive a kqueue event that a directory has been written to I attempt to 
use contentsOfDirectoryAtPath to get a shallow, no subdirectories, list I can 
check for a file I didn't previously know about. This list does appear to 
include .DS_Store, the result being that I keep thinking this is the file being 
created.

2012-07-07 17:30:56.658 java[1680:5003] UKKQueue: Detected file change: 
/Users/mjh/trz/
     [exec] 2012-07-07 17:30:56.664 java[1680:5003] created .DS_Store
     [exec] 2012-07-07 17:30:56.665 java[1680:5003] UKKQueue: Detected file 
change: /Users/mjh/trz/
     [exec] 2012-07-07 17:30:56.667 java[1680:5003] created .DS_Store

The code based on UK source as you see. 
Although I don't think relevant you might also note the java as this is being 
run off of jni. 
I just created another hidden file just to verify enumeratorAtURL would default 
skip it and it seems to default ignore.

How do I get the enumeratorAtURL to include the .DS_Store files. Or do I have 
to add my own filter to contentsOfDirectoryAtPath to skip hidden files for 
consistency?



 


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to