Bug 174253

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

Description Ralf Ertzinger 2005-11-26 15:56:08 UTC
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):
coreutils-5.93-4

How reproducible:
always

Steps to Reproduce:
1. Do a "mv a b/" where a is a dir and b does not exist
2.
3.
  
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 16:08:34 UTC
Upstream discussion:
  http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00284.html
  http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00000.html

This isn't a straightforward thing.  Leaving to upstream to decide.

Comment 3 Tim Waugh 2006-01-24 09:23:21 UTC
*** Bug 178717 has been marked as a duplicate of this bug. ***