Bug 174253 - Weird behaviour with mv and directories
Weird behaviour with mv and directories
Product: Fedora
Classification: Fedora
Component: coreutils (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
: 178717 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2005-11-26 10:56 EST by Ralf Ertzinger
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-12-02 11:08:34 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ralf Ertzinger 2005-11-26 10:56:08 EST
Description of problem:
Assume a "mv a b/" where a is a directory and b does not exist. Every UNIX I
have used so far (including every RedHat release up to FC4) treats this as a
rename of a to b (equivalent to "mv a b"). Recent FC devel releases throw an error:

[sun@lain ~/temp (0) 49]$ mkdir a
[sun@lain ~/temp (0) 50]$ ls -ld b
ls: b: No such file or directory
[sun@lain ~/temp (2) 51]$ mv a b/
mv: target `b/' is not a directory: No such file or directory
[sun@lain ~/temp (1) 52]$ mv a b
[sun@lain ~/temp (0) 53]$ 

While there is some justification for the new behaviour I think we should keep
the old one, if just for the reason that it has been always that way.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Do a "mv a b/" where a is a dir and b does not exist
Actual results:
mv complains that b does not exist

Expected results:
rename of a to b (like "mv a b")

Additional info:
Comment 2 Tim Waugh 2005-12-02 11:08:34 EST
Upstream discussion:

This isn't a straightforward thing.  Leaving to upstream to decide.
Comment 3 Tim Waugh 2006-01-24 04:23:21 EST
*** Bug 178717 has been marked as a duplicate of this bug. ***

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