• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: File Detection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >File Detection (From: "Anthony Cheung" <email@hidden>)

  • Prev by Date: classic mac os lists? please help.
  • Next by Date: Re: getting the size of the current window
  • Previous by thread: Re: File Detection
  • Next by thread: Re: File Detection
  • Index(es):
    • Date
    • Thread