[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-fileutils] "mv" command -- Unexpected Behavior on Linux
From: |
Jim Meyering |
Subject: |
Re: [Bug-fileutils] "mv" command -- Unexpected Behavior on Linux |
Date: |
20 Sep 2000 09:21:27 +0200 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.6.92 |
Thanks for the report.
There is a bug in mv from fileutils-4.0 that would strike
when moving a directory into itself.
You mention 4.0p. However, not all of the reports in this thread
appear to be using that version. In particular, this message
mv: web/web/d1: won't create hard link `web/web' to directory `(null)'
must have been produced by an earlier version (probably 4.0).
That mv moves hierarchies between file systems may be unexpected
to some, but GNU mv now provides that by default because it's useful and
logical (at least to those not accustomed to the historical limitation).
Also, it's mandated by POSIX.
If you find that the latest test release
does something unexpected, please let me know.
ftp://alpha.gnu.org/gnu/fetish/fileutils-4.0z.tar.gz
I've heard that some unfortunate folks can't reach that URL due to
overly-restrictive corporate filtering mechanisms. Here's another name
for the same file that should work better:
ftp://alpha.gnu.org/gnu/fileutils/fileutils-4.0z.tar.gz
Note: in that release, there's at least one bug I know about:
this fails: `cp -lf src existing-dest'. It's fixed for the next
test release, to be named fileutils-4.0.27, out soon.
Jim
Steve Kann <address@hidden> writes:
| Hello fileutils maintainers,
|
| I'm forwarding this thread to you that clearly describes an
| "unexpected behavior" in the gnu mv command (4.0p). I'll leave it to
| you to decide if you think it's a "bug" or not, but I'd call it such --
| I'm sure that I'm not the only one that regularly uses the expression
| "mv * new_directory" to move files into a subdirectory, expecting mv to
| do what we've intended, and just complain about not being able to move
| new_directory into itself.
...
| > > > address@hidden charles]$ ls -l
| > > > total 8
| > > > drwxr-xr-x 2 charles charles 4096 Sep 13 12:19 d1
| > > > -rw-r--r-- 1 charles charles 0 Sep 13 12:13 f1
| > > > -rw-r--r-- 1 charles charles 0 Sep 13 12:13 f2
| > > > -rw-r--r-- 1 charles charles 0 Sep 13 12:13 f3
| > > > drwxr-xr-x 2 charles charles 4096 Sep 13 12:19 web
| > > >
| > > > Now you try to do the same thing as in case a:
| > > >
| > > > address@hidden charles]$ mv * web
| > > > mv: web/web/d1: won't create hard link `web/web' to directory `(null)'
This was due to a bug that has since been fixed.
| > > > address@hidden charles]$ ls
| > > > web
| > > > address@hidden charles]$ ls web
| > > > d1 f1 f2 f3 web
| > > > address@hidden charles]$ ls web/web
| > > > f1 f2 f3
| > > >
| > > > Please note that, it does create the web/web (seems to be a hard link).
| > > > On unix, it won't create web/web which makes more sense to me
(consistent with
| > > > or without the additional sub, d1).