[ale] inode change after vi a file ?

Chris Ricker kaboom at oobleck.net
Thu Mar 30 15:33:55 EST 2006


On Thu, 30 Mar 2006, Jesse Guardiani wrote:

> Yeah, this is the only way to do a reliable atomic update on a *NIX 
> filesystem. I suspect VIM doesn't do this everywhere, as I code on a 
> production server that will complain if you vim :w a file while someone 
> is trying to access it. Perhaps VIM causes the file to blink out of 
> existence temporarily? That would be silly, as a simple rename operation 
> would be 100% atomic inside the same filesystem, but it would coincide 
> with what I've seen.

The multi-user locking is done by the swap files

When you do a vi foo, it looks for an existing .foo.swp, then makes 
.foo.swp, then opens foo. 2nd vi run looks for .foo.swp, finds it, warns

later,
chris



More information about the Ale mailing list