Re: native inotify implementation

From: Vladimir Kondratyev <vladimir_at_kondratyev.su>
Date: Sat, 17 May 2025 17:01:30 UTC
On 5/17/25 19:00, David Chisnall wrote:

> My experience as a user was that NOTE_CLOSE was unreliable.  I tried using it to 
> detect when uploads had finished but I never saw it (on ZFS).  I have had 
> producing a working reduced test case for this on my todo list for a while, but 
> I solved my problem by writing my own sftp-server implementation that stored the 
> received ‘file’ in a shared memory object and passed it to another process, so 
> didn’t end up depending on this.
> 
> The only way that I found on FreeBSD to determine that a file was no longer open 
> for writing was via libprocstat, which required root.  Linux has an API for 
> this, apparently, but I didn’t try it.

NOTE_CLOSE never emitted for files opened for write. You need NOTE_CLOSE_WRITE.


-- 
WBR
Vladimir Kondratyev