bug-coreutils
[Top][All Lists]
Advanced

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

bug#5926: feature request: mv -p to create missing target dir


From: Bob Proulx
Subject: bug#5926: feature request: mv -p to create missing target dir
Date: Sun, 19 Oct 2014 17:09:37 -0600
User-agent: Mutt/1.5.23 (2014-03-12)

f0rhum wrote:
> > ...is
> mv 
> > counter to The Unix Philosophy
> ?
> >  Small is
> > beautiful.  Make each program do one thing well.  Choose portability
> > over efficiency.  Use shell scripts to increase leverage and
> > portability.
> 
> Would mv be discarded to the benefit of cp + rm?
> Ok, I know we can't because mv also does in place rename. But when
> it's time to real move who does use cp then rm?

The mv command causes an atomic rename(2) to occur if on the same file
system.  That is not possible when using cp + rm.  Therefore mv is
required.

If mv'ing a file from one file system to another it is impossible to
have an atomic rename().  In that case mv falls back to effectively cp
plus rm.  That is mentioned in the mv documentation.

Bob





reply via email to

[Prev in Thread] Current Thread [Next in Thread]