This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Weird bug with cp -f
"Christopher Faylor" <cgf-no-personal-reply-please@cygwin.com> wrote in message 20041005000738.GA6013@trixie.casa.cgf.cx">news:20041005000738.GA6013@trixie.casa.cgf.cx...
> On Tue, Oct 05, 2004 at 12:10:34AM +0100, Dave Miles wrote:
> >Christopher Faylor wrote:
> >>On Sun, Oct 03, 2004 at 12:03:42AM -0400, Christopher Faylor wrote:
> >>>Works just fine for me.
> >>>
> >>>(WJJFM?)
> >>
> >>Try again: WJFFM.
> >
> >But has not worked for me for some time on Win2K.
>
> It works fine for me on Win2K SP4 on FAT, FAT32, and NTFS partitions.
>
> Maybe your disk is screwed up. If not, maybe you have something set
> on your disk that the majority of users don't. Do you have compression
> or encryption turned on?
>
System information:
OS Name Microsoft Windows 2000 Professional
Version 5.0.2195 Service Pack 4 Build 2195
OS Manufacturer Microsoft Corporation
Two seperate disks with primary (c:, g:, j:) and extended partitions
(d:, k:, l:) on each.
All partitions formatted under NTFS without compression or
encryption enabled.
Windows disk management reports all healthy.
Now the fun bit begins...
1). created file in 'c:/temp' and attempt to 'cp' it ('cp' works fine)
Administrator@stack01 /cygdrive/c
$ cd temp
Administrator@stack01 /cygdrive/c/temp
$ ls -l cyg*
-rw-r--r-- 1 Administ None 60747 Oct 5 11:11 cyg.out
-rw-r--r-- 1 Administ None 60747 Oct 5 11:34 cyg.out.0
Administrator@stack01 /cygdrive/c/temp
$ rm cyg.out.0
Administrator@stack01 /cygdrive/c/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/c/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/c/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/c/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/c/temp
$ ls -l
total 120
-rw-r--r-- 1 Administ None 60747 Oct 5 11:11 cyg.out
-rw-r--r-- 1 Administ None 60747 Oct 5 11:37 cyg.out.0
drwxrwxrwt+ 2 Administ None 0 Jul 12 12:10 installtemped
2). now re-attempt in 'c:/' ('cp' magically produces a directory)
Administrator@stack01 /cygdrive/c/temp
$ cd ..
Administrator@stack01 /cygdrive/c
$ cp cyg.out cyg.out.0
cp: cannot stat `cyg.out': No such file or directory
Administrator@stack01 /cygdrive/c
$ cp temp/cyg.out .
Administrator@stack01 /cygdrive/c
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/c
$ cp cyg.out cyg.out.0
cp: writing `cyg.out.0': Invalid request code
Administrator@stack01 /cygdrive/c
$ ls -l cyg*
-rw-r--r-- 1 Administ None 60747 Oct 5 11:36 cyg.out
cyg.out.0:
total 0
Problem is I first experienced this 'cp' behaviour within a build
that was copying to a directory path. Therefore I don't think that
using 'cp' within a non-root directory is the solution.
Also 'cp' from (say) c: to d: and attempting the above also gives rise
to a directory.
Since I had some spare disk space I created a FAT32 (m:) and FAT (n:)
drive and repeated (result is everything works as expected):
Administrator@stack01 /cygdrive/c/temp
$ cd m:
Administrator@stack01 /cygdrive/m
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 11:31 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 11:37 cyg.out.0
Administrator@stack01 /cygdrive/m
$ rm cyg.out.0
Administrator@stack01 /cygdrive/m
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 11:31 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 11:37 cyg.out.0
Administrator@stack01 /cygdrive/m
$ mkdir temp
Administrator@stack01 /cygdrive/m
$ cp cyg.out temp
Administrator@stack01 /cygdrive/m
$ cd temp
Administrator@stack01 /cygdrive/m/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/m/temp
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 11:53 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 11:53 cyg.out.0
Administrator@stack01 /cygdrive/m/temp
$ cd n:
Administrator@stack01 /cygdrive/n
$ cp m:/cyg.out .
Administrator@stack01 /cygdrive/n
$ cp m:/cyg.out .
Administrator@stack01 /cygdrive/n
$ cp m:/cyg.out .
Administrator@stack01 /cygdrive/n
$ cp m:/cyg.out .
Administrator@stack01 /cygdrive/n
$ ls -l
total 38
-rw-r--r-- 1 Administ None 37971 Oct 5 11:53 cyg.out
Administrator@stack01 /cygdrive/n
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/n
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/n
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/n
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 11:53 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 2004 cyg.out.0
Administrator@stack01 /cygdrive/n
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 11:53 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 11:53 cyg.out.0
Administrator@stack01 /cygdrive/n
$ mkdir temp
Administrator@stack01 /cygdrive/n
$ cp cyg.out temp
Administrator@stack01 /cygdrive/n
$ cd temp
Administrator@stack01 /cygdrive/n/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/n/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/n/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/n/temp
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 11:53 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 2004 cyg.out.0
Finally think 'OK! So try it on a newly created NTFS partition'
(drive o:)...
Administrator@stack01 ~
$ cd o:
Administrator@stack01 /cygdrive/o
$ cp m:/cyg.out .
Administrator@stack01 /cygdrive/o
$ ls -l
total 38
-rw-r--r-- 1 Administ None 37971 Oct 5 12:05 cyg.out
Administrator@stack01 /cygdrive/o
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/o
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/o
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/o
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/o
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 12:05 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out.0
Administrator@stack01 /cygdrive/o
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 12:05 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out.0
Administrator@stack01 /cygdrive/o
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 12:05 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out.0
Administrator@stack01 /cygdrive/o
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 12:05 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out.0
Administrator@stack01 /cygdrive/o
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 12:05 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out.0
Administrator@stack01 /cygdrive/o
$ mkdir temp
Administrator@stack01 /cygdrive/o
$ cd temp
Administrator@stack01 /cygdrive/o/temp
$ cp ../cyg.out .
Administrator@stack01 /cygdrive/o/temp
$ cp cyg.out cyg.out.0
Administrator@stack01 /cygdrive/o/temp
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out.0
Administrator@stack01 /cygdrive/o/temp
$ cp ../cyg.out .
Administrator@stack01 /cygdrive/o/temp
$ ls -l
total 76
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out
-rw-r--r-- 1 Administ None 37971 Oct 5 12:06 cyg.out.0
Success.
Interestingly creating a file via 'touch' and copying it seems to work:
Administrator@stack01 /cygdrive/o/temp
$ cd c:
Administrator@stack01 /cygdrive/c
$ touch b
Administrator@stack01 /cygdrive/c
$ cp b b.b
Administrator@stack01 /cygdrive/c
$ ls -l b*
-rw-r--r-- 1 Administ None 0 Oct 5 12:11 b
-rw-r--r-- 1 Administ None 0 Oct 5 12:11 b.b
Administrator@stack01 /cygdrive/c
$ cp b b.b
Administrator@stack01 /cygdrive/c
$ ls -l b*
-rw-r--r-- 1 Administ None 0 Oct 5 12:11 b
-rw-r--r-- 1 Administ None 0 Oct 5 12:11 b.b
I'd like to understand what exctly is causeing this so any suggestions
etc... I'm willing to try.
Regards,
Dave Miles
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/