possible multiple notification of the same change, or premature notification...

19 views
Skip to first unread message

steve emmons

unread,
Mar 13, 2013, 7:49:04 PM3/13/13
to guar...@googlegroups.com
i've been using listen (0.7.3) and rb-inotify (0.9.0) to watch a directory of files being uploaded using vsftpd (2.3.5) on ubuntu (12.04.2 LTS).

i may be the fault of the service delivering FTP files to me, but i'm experiencing a problem where i am notified of modifications to a file that is being overwritten, but when i read the file, it is corrupted. a few seconds later i receive another notification and i can process the file successfully.

i suspect the FTP delivery service, because when i first get the notification the file is small (e.g., 200+ bytes), and when i get the later notification, the file is larger (e.g., 2000+) bytes.

however, the odd thing is that the File.mtime is the same for both notifications, which makes me wonder if somehow i'm getting an intermediate notification other than the IN_CLOSE_WRITE flag from inotify.

thanks!

Michael Kessler

unread,
Mar 14, 2013, 1:40:31 AM3/14/13
to guar...@googlegroups.com
You can use inotifywatch to analyze the events, more details at https://github.com/guard/guard/wiki/Analysis-of-inotify-events-for-different-editors You may want then to overwrite https://github.com/guard/listen/blob/master/lib/listen/adapters/linux.rb#L17 and adapt the event list to your outcome.
> --
> You received this message because you are subscribed to the Google Groups "guard-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to guard-dev+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages