Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#479764: shell builtin mv fails to move files across devices
- X-seq: zsh-workers 24954
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: zsh-workers@xxxxxxxxxx, martin f krafft <madduck@xxxxxxxxxx>, 479764@xxxxxxxxxxxxxxx
- Subject: Re: Bug#479764: shell builtin mv fails to move files across devices
- Date: Tue, 6 May 2008 19:52:48 +0100
- In-reply-to: <20080506150303.GB31177@xxxxxxxx>
- Mail-followup-to: zsh-workers@xxxxxxxxxx, martin f krafft <madduck@xxxxxxxxxx>, 479764@xxxxxxxxxxxxxxx
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080506144208.GA15225@xxxxxxxxxxxxxxxxx> <20080506150303.GB31177@xxxxxxxx>
On Tue, May 06, 2008 at 04:03:03PM +0100, Clint Adams wrote:
> On Tue, May 06, 2008 at 03:42:08PM +0100, martin f krafft wrote:
> > lapse:~/debian|master|debian.ch% echo $ZSH_VERSION
> > 4.3.6-dev-0+0428
> > lapse:~/debian|master|debian.ch% zmodload zsh/files
> > lapse:~/debian|master|debian.ch% which mv
> > mv: shell built-in command
> > lapse:~/debian|master|debian.ch% mv /tmp/debian.ch_T-Shirt_20080422-poll.png .
> > mv: /tmp/debian.ch_T-Shirt_20080422-poll.png: invalid cross-device link
>
> Anyone up for changing this in a future version?
>
> Note that this mv will not move files across devices. Historical
> versions of mv, when actual renaming is impossible, fall back on copying
> and removing files; if this behaviour is desired, use cp and rm manually.
> This may change in a future version.
Note that POSIX requires mv to be able to move files (and now
directories) accross file systems. Note that it's quite a
complex task as it involves recreating the files as they were
(permissions, ownership, ACLs, sparse files), handle conflicts,
handle hard links correctly, and handle the error cases
properly. It's not as simple as cp+rm, it would rather be pax
-rw && rm -rf
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author