Re: Stdio.File()->notify

Pontus Östlund <[email protected]>
Newsgroups gmane.comp.lang.pike.user
Message-ID <CAAyMhKxR8HNfHUB9eG=ceeOAduUw6Kh=ah=X1nXK_Zfi3GZ9GQ@mail.gmail.com>
Cool! I guess Inotify is a fairly recent addition to Pike so I had to pull
down Pike 8, but I got it working after that.

Thanks a bunch! :)

# Pontus

2014-09-23 11:20 GMT+02:00 Arne Goedeke <[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
>>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.