• 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: Tue, 29 Apr 2003 18:20:32 +0200

Hi

No problem ;-)

[NSWorkspace noteFileSystemChanges:(NSString *)path] is surely not what you are looking for.
This functin does inform the system that there has been a file system change at *path*
The system can use this to update finder windows or something like this, if *path* is open...


Am Dienstag, 29.04.03 um 05:28 Uhr schrieb Anthony Cheung:

Hi Andreas,

Thanks for your help. I have studied NSWorkspace and found that method
noteFileSystemChanged:(NSString *)path. It said it gets the status of all
the files and directories it is interested in and updates itself
appropriately. Do you think that can help? Do you have some sample code for
this?

Many thanks. :)

Regards,

Anthony

----- Original Message -----
From: "Andreas Schempp" <email@hidden>
To: "Anthony Cheung" <email@hidden>
Cc: <email@hidden>
Sent: Monday, April 28, 2003 10:10 PM
Subject: Re: File Detection


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.

  • Follow-Ups:
    • Re: File Detection
      • From: Daryl Thachuk <email@hidden>
  • Prev by Date: NSLinkAttributeName not kept when saved to RTFD?
  • Next by Date: Re: NSMovieView Interface Object Question
  • Previous by thread: Re: File Detection
  • Next by thread: Re: File Detection
  • Index(es):
    • Date
    • Thread