Bug 3520 - mv will copy a directory into itself in certain situations
Summary: mv will copy a directory into itself in certain situations
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: fileutils
Version: 6.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-06-17 05:03 UTC by alborchers
Modified: 2008-05-01 15:37 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 1999-09-25 03:04:39 UTC


Attachments (Terms of Use)

Description alborchers 1999-06-17 05:03:30 UTC
"mv * newdir" creates newdir/newdir and copies files twice.
Recursion stops after one level (thankfully) and only the
files, not subdirectories are copied into newdir/newdir.

This only happens if there are other subdirectories that are
being moved; for example, in the following script, there is
no problem if the subdirectory "dir" is not present.

   Example script:
[test] ls
[test] > file1
[test] mkdir dir newdir
[test] mv * newdir
mv: newdir/newdir/dir: won't create hard link `newdir/dir'
to directory `(null)'
[test] ls -R
.:
newdir

newdir:
dir  file1  newdir

newdir/dir:

newdir/newdir:
file1

Comment 1 Jeff Johnson 1999-06-17 15:29:59 UTC
I'm changing component to fileutils.

Comment 2 Bill Nottingham 1999-09-25 03:04:59 UTC
Should be fixed in the latest fileutils in Raw Hide.


Note You need to log in before you can comment on or make changes to this bug.