Search the web
Sign In
New User? Sign Up
radio-dev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
File system monitoring (for improved upstreaming)   Message List  
Reply | Forward Message #8423 of 8443 |
Re: File system monitoring (for improved upstreaming)

Hello there,

I saw this today on the AppleScript Users list and though that it could
be of interest for the people here. I'm forwarding this also to the
FrontierKernel list.

Cheers
-Emmanuel

>Date: Fri, 29 Jul 2005 14:55:32 +0200
>From: Le Stang Jean-Baptiste <lists@...>
>Subject: Re: [OT] "Message" when file created.
>Cc: AppleScript Users <applescript-users@...>
>Message-ID: <848E60AC-8A73-4DBB-88EA-55FFF81AD3E4@...>
>
>> I seem to remember that there's a low level system message created
>> when a file is created. Basically, when a file is created the system
>> notices and does something which can be hooked into by other apps.
>> Does this ring any bells with anyone? If so, can you point me in
>> vaguely the right direction (a starter would be to get the
>> terminology right!).
>>
>
>I'm not sure this is really the best place to talk about that, but you
>can have a look to 'kqueue(s)', that were introduced in Mac OS X. 3,
>'kqueue(s)' can detect file creation, file modification, and many
>other events related to file I/O. (could be a very good companion to
>folder actions) :
>
>Here is a nice sample showing what can be done with 'kqueue(s)' :
><http://developer.apple.com/samplecode/FileNotification/
FileNotification.html>
>
>This sample includes a detailed PDF report explaining kqueue(s).

>Date: Sun, 31 Jul 2005 19:28:39 -0400
>From: Chris Garaffa <chris@...>
(...)
>If you're more comfortable with Cocoa, try Uli Kusterer's UKKQueue
>class: <http://www.zathras.de/programming/sourcecode.htm>. I've used
>it with success, but have never tried calling it from AppleScript
>(you'd have to do that via "call method" in a Studio app).

Also, there is a pointer in this thread to this web page and fslogger.

kernelthread.com
A File System Change Logger for "Tiger"
<http://www.kernelthread.com/software/fslogger/>

>FSLogger
>
>FSLogger is a user-space program for Mac OS X 10.4 "Tiger". It
>subscribes to the same file system event notificatio mechanism as the
>Spotlight metadata server
>
> Note that fslogger doe not use the Spotlight APIs. It uses the
> mechanism underlying to Spotlight.
>
>fslogger's mode of operation is very simple. The following points are
>particularly noteworthy
>
>It must be run as root, for example, via the sudo command. This is so
>because subscribing to the kernel's file system change notification
>service requires super-user privileges.
>
>It takes no useful arguments. You can, however, pass in arbitrary
>arguments that will result in an informational message.
>
>It does not interfere with the working of Spotlight, since the kernel
>supports multiple such subscribers.
>
>It will not run on any Mac OS X version older than 10.4.
>
>Once active, fslogger will wait for change notifications to arrive
>from the file system layer in the kernel. The variou file system
>operations that are communicated to fslogger (and other subscribers
>such as Spotlight, specifically th metadata server) include
>
>File creation
>Folder creation
>File or folder deletion
>Changes to the stat structure (for example, a permission change)
>Renaming of a file or a folder
>Content modification
>Content exchange between two files
>Finder information changes
>Change of ownership

--
Emmanuel Décarie / Programmation pour le Web - Programming for the Web
<http://scriptdigital.com/> - Blog: <http://blog.scriptdigital.com> -
AIM: scriptdigital



Thu Aug 4, 2005 1:16 pm

emmanueldecarie
Offline Offline
Send Email Send Email

Forward
Message #8423 of 8443 |
Expand Messages Author Sort by Date

Hi. Are you guys (UL & co-conspirators) familiar with KQueue? http://people.freebsd.org/~jlemon/papers/kqueue.pdf which seems to offer native OS based File...
Matt Mower
mowerm
Offline Send Email
Jul 4, 2005
9:05 pm

... Thanks Matt. I had heard about Kqueues under BSD but had never read the definitive white paper before. Kqueues seem to provide pretty much all we would...
Marc Barrot
mb1022002
Offline Send Email
Jul 5, 2005
4:14 pm

... On my system (10.4.1) man 'kqueue' gives NAME kqueue, kevent -- kernel event notification mechanism LIBRARY Standard C Library (libc, -lc) M -- Matt Mower...
Matt Mower
mowerm
Offline Send Email
Jul 5, 2005
4:57 pm

... I checked my 10.3.9 system (still haven't found time to instal the Tiger I bought from Apple :-), and it is fully documented in there as well. The next...
Marc Barrot
mb1022002
Offline Send Email
Jul 5, 2005
5:43 pm

... A little googling around has unearthed a few kqueue wrapper classes for Cocoa so I guess kqueue notification must work at least to some extent with HFS+...
Marc Barrot
mb1022002
Offline Send Email
Jul 5, 2005
6:05 pm

Hello there, I saw this today on the AppleScript Users list and though that it could be of interest for the people here. I'm forwarding this also to the ...
Emmanuel Décarie
emmanueldecarie
Offline Send Email
Aug 4, 2005
1:19 pm

Thanks Emmanuel. I haven't taken a close look at the C code provided at http://developer.apple.com/samplecode/FileNotification/FileNotification.html but it...
Marc Barrot
mb1022002
Offline Send Email
Aug 8, 2005
2:42 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help