Bug 192239

Summary: NOTE_TRUNCATE not supported
Product: Base System Reporter: ericshane
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: New ---    
Severity: Affects Some People    
Priority: ---    
Version: 10.0-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
a minimal program for printing VNODE events on BSD none

Description ericshane 2014-07-29 13:22:47 UTC
Created attachment 145120 [details]
a minimal program for printing VNODE events on BSD

On OpenBSD /usr/include/sys/event.h defines a filer for watching responding file truncation:

#define·NOTE_TRUNCATE   0x0080       /* vnode was truncated */

On FreeBSD this is not defined, and does not appear to be covered by any other filers

$ echo "test" > file.txt # NOTE_WRITE
$ : > file.txt           # NOTE_TRUNCATE

I'm filing this bug on behalf of the entr utility (http://entrproject.org) since this leaves an edge case where a file is altered without triggering an action.