Bug#479764: shell builtin mv fails to move files across devices
  Home FAQ Contact Sign in
linux.debian.bugs.dist only
 
Advanced search
POPULAR GROUPS

more...

linux.debian.bugs.dist Profile…
 Up
Bug#479764: shell builtin mv fails to move files across devices         


Author: martin f krafft
Date: May 6, 2008 07:50

Package: zsh-beta
Version: 4.3.6-dev-0+20080428-1
Severity: normal

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

-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24-1+scoflowctrl.1-686 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Show full article (1.72Kb)
10 Comments
Bug#479764: shell builtin mv fails to move files across devices         


Author: Clint Adams
Date: May 6, 2008 08:10

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.

--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Author: Bart Schaefer
Date: May 6, 2008 09:10

On May 6, 4:03pm, Clint Adams wrote:
}
} 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.

I'd rather we didn't. rename(2) is atomic, but there's no reasonable way
to make cp+rm be so, and I think it's better if the user is forced to be
aware of the issue.

Also note that "cp" is (intentionally) NOT one of the commands supplied
by the zsh/files module, so changing mv means implementing cp.

--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Author: martin f krafft
Date: May 6, 2008 10:10

also sprach Bart Schaefer brasslantern.com> [2008.05.06.1645 +0100]:
> I'd rather we didn't. rename(2) is atomic, but there's no
> reasonable way to make cp+rm be so, and I think it's better if the
> user is forced to be aware of the issue.
>
> Also note that "cp" is (intentionally) NOT one of the commands
> supplied by the zsh/files module, so changing mv means
> implementing cp.

What, if I may ask, is the purpose of zsh/files?

--
.''`. martin f. krafft debian.org>
: :' : proud Debian developer, author, administrator, and user
`. `'` http://people.debian.org/~madduck - http://debiansystem.info
`- Debian - when you have better things to do than fixing systems

you can't assign IP address 127.0.0.1 to the loopback adapter,
because it is a reserved address for loopback devices.
-- micro$oft windoze xp professional

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Show full article (1.09Kb)
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Author: Stephane Chazelas
Date: May 6, 2008 12:00

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...
Show full article (1.38Kb)
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Date: May 6, 2008 14:20

On 2008-05-06 at 17:55 +0100, martin f krafft wrote:
> What, if I may ask, is the purpose of zsh/files?

If I correctly recall the gist of a verbal conversation about 11 years
ago with the author, in a university environment with heavily multi-user
systems which were often abused by people writing My First Fork Bomb, it
was to have the availability to load in sufficient builtins to make it
easier to deal with systems which won't let you fork() anymore more; to
do basic recovery work and have the commands available; to avoid fork()
overheads when dealing with a loaded single-CPU Solaris box, etc.

But mostly, IIRC, to build a static version of the shell with the module
already loaded, to put on a boot/recovery diskette and so reduce what
was needed.

It pre-dates busybox, which has since become the common way of doing
this.

It wasn't intended to provide full versions of the commands, the
commands which are there don't implement all the POSIX options, etc.
It's intended to provide enough to be useful in emergencies.

Most people shouldn't need to use it.
Show full article (1.69Kb)
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Author: Peter Stephenson
Date: May 6, 2008 14:20

On Tue, 6 May 2008 17:55:55 +0100
martin f krafft debian.org> wrote:
> also sprach Bart Schaefer brasslantern.com> [2008.05.06.1645 +0100]:
>> I'd rather we didn't. rename(2) is atomic, but there's no
>> reasonable way to make cp+rm be so, and I think it's better if the
>> user is forced to be aware of the issue.
>>
>> Also note that "cp" is (intentionally) NOT one of the commands
>> supplied by the zsh/files module, so changing mv means
>> implementing cp.
>
> What, if I may ask, is the purpose of zsh/files?

Its primary purpose has been as a fallback on a system where the shell
is working but nothing much else is. Hence it provides the limited,
easy-to-implement things you're likely to need to fix what needs
fixing. Moving things between file systems typically isn't something
you need (though in any given case it may be, as well as a whole load of
other stuff the shell doesn't provide).
Show full article (1.20Kb)
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Author: Vincent Lefevre
Date: May 7, 2008 14:40

On 2008-05-06 13:55:23 -0700, Phil Pennock wrote:
> Most people shouldn't need to use it.

I use it *by default* just because of the Linux kernel bug^Wlimitation
concerning the argument list (I often exceed it). But perhaps I should
write my own shell function as a wrapper to coreutils and use xargs or
zargs when necessary.

--
Vincent Lefèvre vinc17.org> - Web: <http://www.vinc17.org/>
100%% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)

--
To UNSUBSCRIBE, email to debian-bugs-dist-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Date: May 7, 2008 15:00

On 2008-05-07 at 23:30 +0200, Vincent Lefevre wrote:
> On 2008-05-06 13:55:23 -0700, Phil Pennock wrote:
>> Most people shouldn't need to use it.
>
> I use it *by default* just because of the Linux kernel bug^Wlimitation
> concerning the argument list (I often exceed it). But perhaps I should
> write my own shell function as a wrapper to coreutils and use xargs or
> zargs when necessary.

Would it make more sense for your usage if Zsh used the new "features"
capabilities to resolve this? Would this also help with the Debian
situation, in addition to documentation notes?

They were added by Peter after I sent a proposed patch renaming
zsh/stat's stat to zstat, with a stat deprecated backwards-compatible
name, since a stat(1) external command has come along in the years since
zsh's stat module was introduced with incompatible behaviour.

Peter just looked at the logical conclusion and put in a lot more work
to do the Right Thing.
Show full article (1.37Kb)
no comments
Bug#479764: shell builtin mv fails to move files across devices         


Author: Vincent Lefevre
Date: May 7, 2008 16:00

On 2008-05-07 14:47:45 -0700, Phil Pennock wrote:
> Would it make more sense for your usage if Zsh used the new "features"
> capabilities to resolve this?

Yes. IIRC, the only features (standard or not) I really miss are
the -v option (verbose), the -n option for ln, the -u option for
mv, and mv across devices.
> For zsh/files it's not quite as simple as adding a z in front of the
> names, since we already have zmv, but if there were alternate names
> which would allow you to use Features to load only those names?

Names are not really important for me since it is easy to write a
shell function like:

rm() { command rm $@ }

or

rm() { builtin rm $@ }

--
Vincent Lefèvre vinc17.org> - Web: <http://www.vinc17.org/>
100%% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
Show full article (1.04Kb)
no comments
 
1 2