Re: File Detection
Re: File Detection
- Subject: Re: File Detection
- From: Andreas Schempp <email@hidden>
- Date: Mon, 28 Apr 2003 16:10:03 +0200 (MEST)
You can try to use the NSWorkspace notificationCenter to detect file system
changes.
Register for NSWorkspaceDidPerformFileOperationNotification on the
[NSWorkspace notificationCenter]
This will tell you whenever ANYTHING on your disk is changed, I don't know
if this is too much...
Better let the user decide how often to check for folder changes (slider for
timer).
I don't think its too bad to check every - say - 2 minutes for new files.
I think NSFileManager would not work, because you have to define an absolute
path. You can't specifie a folder, because the folder is not moved, copied
or renamed. Only it's content is changed.
>
Hello everyone,
>
>
I am writing a Cocoa application which detects what files are go into a
>
folder, that is a hot folder. I have checked NSFileManager which provides
>
a
>
delegate method - willProcessPath: . However, it seems that NSFileManager
>
doesn't have any notification center.
>
>
Then what I do is to attach a NSTimer and regularly check if there is any
>
new
>
file come into the folder. However, I am afraid that will involve a lot of
>
processor resource. Would you kindly suggest another method.
>
>
Regards,
>
>
Anthony Cheung
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.