From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8729 invoked from network); 6 May 2008 18:53:03 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.4 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 6 May 2008 18:53:03 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 36348 invoked from network); 6 May 2008 18:52:58 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 6 May 2008 18:52:58 -0000 Received: (qmail 18403 invoked by alias); 6 May 2008 18:52:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 24954 Received: (qmail 18389 invoked from network); 6 May 2008 18:52:53 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 6 May 2008 18:52:53 -0000 Received: from mail.o2.co.uk (yoda.london.02.net [82.132.130.151]) by bifrost.dotsrc.org (Postfix) with ESMTP id 507B380ED173 for ; Tue, 6 May 2008 20:52:49 +0200 (CEST) Received: from sc.homeunix.net (78.105.216.138) by mail.o2.co.uk (8.0.013.3) (authenticated as stephane.chazelas) id 480343A702E7DBE9; Tue, 6 May 2008 19:52:49 +0100 Received: from chazelas by sc.homeunix.net with local (Exim 4.69) (envelope-from ) id 1JtSHQ-0004Or-SF; Tue, 06 May 2008 19:52:48 +0100 Date: Tue, 6 May 2008 19:52:48 +0100 From: Stephane Chazelas To: zsh-workers@sunsite.dk, martin f krafft , 479764@bugs.debian.org Subject: Re: Bug#479764: shell builtin mv fails to move files across devices Message-ID: <20080506185248.GA5230@sc.homeunix.net> Mail-Followup-To: zsh-workers@sunsite.dk, martin f krafft , 479764@bugs.debian.org References: <20080506144208.GA15225@lapse.madduck.net> <20080506150303.GB31177@scru.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080506150303.GB31177@scru.org> User-Agent: Mutt/1.5.16 (2007-09-19) X-Virus-Scanned: ClamAV 0.91.2/7040/Tue May 6 03:52:15 2008 on bifrost X-Virus-Status: Clean 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