BSD vi/view resets inode ctime: why?

Tony Luck aegl at root.co.uk
Fri Mar 13 22:16:59 AEST 1987


Under 4.2 it did this because vi uses fsync(2) whenever it reads or
writes a file. The fsync system call updates the ctime field in the
stat structure. I guess this is still the case in 4.3.

I never understood why vi 'fsync'd while *reading* a file, nor why
fsync had any effect on a file descriptor that was only open for
reading, nor what real reliability gain was produced by using fsync
in vi at all.

I "fixed" this by just removing the call from vi.

Tony Luck - Technical manager (aegl at root.co.uk or ...!ukc!root44!aegl)



More information about the Comp.unix.wizards mailing list