• 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: Monitoring a folder?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Monitoring a folder?


  • Subject: Re: Monitoring a folder?
  • From: Chris Pavicich <email@hidden>
  • Date: Tue, 20 Apr 2004 13:36:10 -0400

Matt:

Kqueue will also watch files. It's not available prior to 10.3, unfortunately.

Not sure about Folder Actions, but I would guess that they cannot be attached to a single file. (If someone else has more info, please correct me).

HTH,
CMP



On Tuesday, April 20, 2004, at 12:33PM, Matt Jaffa <email@hidden> wrote:

>Do these techniques also apply to files within a folder,
>I want to watch a file for any changes made to it,
>and want it to be compatible with 10.2 and 10.3,
>
>but maybe just 10.3 if I want my app to not support 10.2
>
>Thanks,
>Matt
>
>
>On Apr 20, 2004, at 10:07 AM, Shawn Erickson wrote:
>
>> On Apr 20, 2004, at 8:26 AM, Christoffer Lerno wrote:
>>
>>> Would it be possible to have a program that watches a folder and gets
>>> notified whenever something is written to it? Is it possible to maybe
>>> even get information about the process that made the change (creating
>>> a new file, changing file contents etc)
>>
>> You can attach AppleScripts to a folder that can do things, they are
>> called Folder Actions [1].
>>
>> Additionally you can use kqueues [2] to monitor changes like what you
>> outlined. Apple even provides a code example of this [3].
>>
>> -Shawn
>>
>> [1] <http://www.apple.com/applescript/folderactions/>
>> [2]
>> <http://developer.apple.com/documentation/Darwin/Reference/ManPages/
>> html/kqueue.2.html>
>> [3]
>> <http://developer.apple.com/samplecode/FileNotification/
>> FileNotification.html>
>> _______________________________________________
>> 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.
_______________________________________________
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.


  • Prev by Date: Re: Inserting in a read-only NSTextView?
  • Next by Date: Re: Inserting in a read-only NSTextView?
  • Previous by thread: Re: Monitoring a folder?
  • Next by thread: Cocoa bindings and NSOutlineView
  • Index(es):
    • Date
    • Thread