[launchd-dev] WatchEvents and unlink

Alfred Labrie alfred.labrie at gmail.com
Tue Mar 23 09:24:10 PDT 2010


Hello

I am sorry to "bump" but I am really wondering if it is normal behavior.

Please help.

A.


On Wed, Mar 17, 2010 at 3:03 PM, Alfred Labrie <alfred.labrie at gmail.com> wrote:
> Hello
>
> It sounds like there is a new behavior with WatchEvents on Snow Leopard.
>
> Let's say, I watch for this file path: "/private/tmp/watch"
> - if I create the file, launch daemon is triggered
> - if I write + close the file, launch daemon is triggered
> - if I remove the file then I create a new file, launch daemon is no
> longer triggered
>
> On Leopard, remove then create the file would trigger the launch daemon.
>
> Typical watch.plist syntax would be:
> ...
> <dict>
>        <key>KeepAlive</key>
>        <false/>
>        <key>Label</key>
>        <string>inc.ninja.watch</string>
>        <key>ProgramArguments</key>
>        <array>
>                <string>/path/to/execute</string>
>        </array>
>        <key>WatchPaths</key>
>        <array>
>                <string>/private/tmp/watch</string>
>        </array>
> </dict>
> </plist>
>
> This is tested on Mac OS X 10.6.2 and above. Is it by design or is it a bug?
>
> Regards.
>


More information about the launchd-dev mailing list