Bug 174253

Summary: Weird behaviour with mv and directories
Product: [Fedora] Fedora Reporter: Ralf Ertzinger <redhat-bugzilla>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: lsof
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-12-02 11:08:34 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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. ***