for large files or slow connections, copying files may take some time.
using pyinotify, i have been watching for the IN_CREATE event code. but this seems to occur at the start of a file transfer. i need to know when a file is completely copied – it aint much use if it’s only half there.
when a file transfer is finished and completed, what inotify event is fired?
IN_CLOSEprobably means the write is complete. This isn’t for sure since some applications are bad actors and open and close files constantly while working with them, but if you know the app you’re dealing with (file transfer, etc.) and understand its’ behaviour, you’re probably fine. (Note, this doesn’t mean the transfer completed successfully, obviously, it just means that the process that opened the file handle closed it).IN_CLOSEcatches bothIN_CLOSE_WRITEandIN_CLOSE_NOWRITE, so make your own decisions about whether you want to just catch one of those. (You probably want them both –WRITE/NOWRITEhave to do with file permissions and not whether any writes were actually made).There is more documentation (although annoyingly, not this piece of information) in Documentation/filesystems/inotify.txt.