Subject: bin/8073: mv -i asks for non-existant source files
To: None <gnats-bugs@gnats.netbsd.org>
From: None <wiz@danbala.ifoer.tuwien.ac.at>
List: netbsd-bugs
Date: 07/25/1999 23:16:37
>Number:         8073
>Category:       bin
>Synopsis:       mv -i asks for non-existant source files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 25 22:35:02 1999
>Last-Modified:
>Originator:     Wiz
>Organization:
>Release:        1.2, 1.3.3
>Environment:
System: NetBSD danbala 1.2.1 NetBSD 1.2.1 (DANBALA) #2: Sat Sep 6 03:08:12 MET DST 1997 root@danbala:/usr/src/sys/arch/i386/compile/DANBALA i386
also on
NetBSD 1.3.3 (KALLISTI) #0: Wed Jun  9 10:02:24 PDT 1999
 

>Description:
"mv -i" checks only if the source file exists after it already asked
the user if she wanted to overwrite the destination file.  Also, if
the source file doesn't exist, the man page describes the behaviour
wrongly (for cross-file system moves), since the destination file is
not unlinked before cp is started (which probably is better behaviour
anyway). One could probably mention in the man page that it is an error
for mv if the source-file doesn't exist (picky, I know).

>How-To-Repeat:
rm source-file
touch target-file
mv -i source-file target-file
>Fix:
check for the existence of the source-file before asking the user
for overwrite confirmation.
>Audit-Trail:
>Unformatted: