[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Distinct transactions (MV vs rename())?



On Wed, Sep 12, 2001 at 09:51:33AM +0100, Stephen C. Tweedie wrote:
> Hi,
> 
> On Tue, Sep 11, 2001 at 05:20:44PM -0700, KRELLE,BRIAN (HP-Roseville,ex1) wrote:
> 
> > I was rooting around in the MV code.  It seems to perform an unlink()
> > then a link() if the filename already exists (Theodore Tso please
> > correct me if I'm wrong).  This implies to me there is a moment where
> > the filename (i.e. "current") is not in the directory.
> 
> $ touch a
> $ touch b
> $ strace mv a b
> [...]
> stat64("b", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> lstat64("a", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> lstat64("b", {st_mode=S_IFREG|0644, st_size=0, ...}) = 0
> rename("a", "b")                        = 0
> _exit(0)                                = ?
> $
> 
> Seems to be atomic to me.
> 

Just for a data point... What version of mv is that?





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]