tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kevent monitoring of file system changes

> 1) If I am monitoring a file, for example, called 'a' and I copy
> another file over it then I get a write event and an extend event.
> If I copy the same file over it again I would have thought I should
> just get a write event as the file size would be the same (no need to
> extend), but I find that I still get both events reported.  The same
> is true if the target is overwritten with a smaller file!

Most file copy programs open the target with O_TRUNC, then write.  THis
means that the target is always being extended, since it is truncated
to zero size as of the open().

Does it still work the same way if you copy using dd conv=notrunc?
(That's one of the few ways in the stock system to copy a file's
contents without truncating the target first.)

> 2) If I remove the NOTE_EXTEND attribute from the list [...]

No idea here.  I don't really know kevent.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

Home | Main Index | Thread Index | Old Index