[ale] inode change after vi a file ?

Jerry Yu jjj863 at gmail.com
Thu Mar 30 14:50:20 EST 2006


programs hold fd against the old inum will be at loss ...

On 3/30/06, Jesse Guardiani <jesse at wingnet.net> wrote:
>
> Chris Ricker wrote:
> > On Thu, 30 Mar 2006, Jerry Yu wrote:
> >
> >> To my surprise, the inode #  changes as long as I do ":w" inside
> vi.  This
> >> holds true on a stock installation of CentOS 4.1 and CentOS 4.3(equivalent
> >> of RHEL 4.* AS) . Anyone knows this is a new feature? If it is a
> feature,
> >> I'd like to learn ways to turn it off.
> >>
> >> [zyu at saturn ~]$ date > blah; ls -i blah; vi blah; ls -i blah
> >> 688427 blah
> >> 692394 blah
> >
> > It's making a new temporary file that you're editing, then moving it
> over
> > the original file....
>
> 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.
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>
-------------- next part --------------
An HTML attachment was scrubbed...




More information about the Ale mailing list