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!