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

Previous Next

Package: coreutils;

Reported by: Rodolfo Borges <rodolfo.borges <at> gmail.com>

Date: Sun, 11 Apr 2010 14:10:02 UTC

Severity: wishlist

Done: Bob Proulx <bob <at> proulx.com>

Bug is archived. No further changes may be made.

Full log


Message #53 received at 5926 <at> debbugs.gnu.org (full text, mbox):

From: Bob Proulx <bob <at> proulx.com>
To: f0rhum <f0rhum <at> free.fr>
Cc: 5926 <at> debbugs.gnu.org
Subject: Re: bug#5926: feature request: mv -p to create missing target dir
Date: Sun, 19 Oct 2014 17:09:37 -0600
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




This bug report was last modified 10 years and 218 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.