howeyc / fsnotify

File system notification for Go
BSD 3-Clause "New" or "Revised" License
1.99k stars 252 forks source link

Need an Operation for Linux - IN_CLOSE_WRITE #115

Closed radu-munteanu closed 7 years ago

radu-munteanu commented 7 years ago

The real world scenario I have is about knowing when a file is fully copied to a location via FTP, SMB or other means, on Linux. The existing Create doesn't do fully justice to files, only to directories. The Write (IN_MODIFY) operation is not fully helpful in this case, because I can get a lot of these messages, but not knowing exactly when the transfer has finished.

I don't know if there is something similar to IN_CLOSE_WRITE on other systems, that's why I made this issue, to create the base for a discussion.

One way to solve this problem is to create a new cross-platform operation, which on some systems might have the same meaning with Write.

Another way, that is a bit ugly, but will fix any similar issues in the future, is to add the uint32 Mask to the Event. This way any developer could handle the Mask itself, in case it builds a platform specific software.

radu-munteanu commented 7 years ago

Seems I've posted on the old repo. Closed.