Re: Stdio.File()->notify
Arne Goedeke <[email protected]>
| Newsgroups | gmane.comp.lang.pike.user |
|---|---|
| Message-ID | <[email protected]> |
The second argument (a callback) is not actually used by the notify()
code. Instead, you would need to add a signal handler. I would suggest
using System.Inotify, it should work as documented and is much more
flexible.
So, no, you are not doing anything wrong. notify() is not documented
correctly and should probably be removed completely.
Arne
On Tue, 23 Sep 2014, Pontus Ã~Vstlund wrote:
> Hello!
>
> I have a question about the notify method in Stdio.File which I can't get
> to work. Maybe I'm using it wrong or maybe it just doesn't work, I don't
> know.
>
> I'd like to listen for changes in a directory:
>
> Stdio.File dir = Stdio.File("/my/dir");
> dir->notify(
> Stdio.DN_MULTISHOT |
> Stdio.DN_MODIFY |
> Stdio.DN_CREATE |
> Stdio.DN_DELETE |
> Stdio.DN_RENAME,
> lambda() {
> werror("Hello\n");
> }
> );
>
> but nothing seems to happen. Am I doing something wrong?
>
> And yes, I'm using Linux.
>
> Regards
> # Pontus
>