delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/05/08:11:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
From: "Dave Miles" <stack AT freenet DOT co DOT uk>
Subject: Re: Weird bug with cp -f
Date: Tue, 5 Oct 2004 12:18:39 +0100
Lines: 355
Message-ID: <cjtvu4$nnd$1@sea.gmane.org>
References: <000601c4a90d$0d18bad0$210110ac AT NEEEEEEE> <20041003040342 DOT GA25772 AT trixie DOT casa DOT cgf DOT cx> <20041003041441 DOT GB25772 AT trixie DOT casa DOT cgf DOT cx> <20041004231101 DOT E08D01B3F9 AT cgf DOT cx> <20041005000738 DOT GA6013 AT trixie DOT casa DOT cgf DOT cx>
X-Complaints-To: usenet AT sea DOT gmane DOT org
X-Gmane-NNTP-Posting-Host: host81-136-216-71.in-addr.btopenworld.com
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-IsSubscribed: yes

"Christopher Faylor" <cgf-no-personal-reply-please AT cygwin DOT com> wrote in message news:20041005000738 DOT GA6013 AT trixie DOT casa DOT cgf DOT 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 AT stack01 /cygdrive/c
  $ cd temp

  Administrator AT 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 AT stack01 /cygdrive/c/temp
  $ rm cyg.out.0

  Administrator AT stack01 /cygdrive/c/temp
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/c/temp
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/c/temp
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/c/temp
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT stack01 /cygdrive/c/temp
  $ cd ..

  Administrator AT stack01 /cygdrive/c
  $ cp cyg.out cyg.out.0
  cp: cannot stat `cyg.out': No such file or directory

  Administrator AT stack01 /cygdrive/c
  $ cp temp/cyg.out .

  Administrator AT stack01 /cygdrive/c
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/c
  $ cp cyg.out cyg.out.0
  cp: writing `cyg.out.0': Invalid request code

  Administrator AT 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 AT stack01 /cygdrive/c/temp
  $ cd m:

  Administrator AT stack01 /cygdrive/m
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/m
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/m
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT stack01 /cygdrive/m
  $ rm cyg.out.0

  Administrator AT stack01 /cygdrive/m
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/m
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT stack01 /cygdrive/m
  $ mkdir temp

  Administrator AT stack01 /cygdrive/m
  $ cp cyg.out temp

  Administrator AT stack01 /cygdrive/m
  $ cd temp

  Administrator AT stack01 /cygdrive/m/temp
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/m/temp
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/m/temp
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT stack01 /cygdrive/m/temp
  $ cd n:

  Administrator AT stack01 /cygdrive/n
  $ cp m:/cyg.out .

  Administrator AT stack01 /cygdrive/n
  $ cp m:/cyg.out .

  Administrator AT stack01 /cygdrive/n
  $ cp m:/cyg.out .

  Administrator AT stack01 /cygdrive/n
  $ cp m:/cyg.out .

  Administrator AT stack01 /cygdrive/n
  $ ls -l
  total 38
  -rw-r--r--    1 Administ None        37971 Oct  5 11:53 cyg.out

  Administrator AT stack01 /cygdrive/n
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/n
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/n
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT 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 AT stack01 /cygdrive/n
  $ mkdir temp

  Administrator AT stack01 /cygdrive/n
  $ cp cyg.out temp

  Administrator AT stack01 /cygdrive/n
  $ cd temp

  Administrator AT stack01 /cygdrive/n/temp
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/n/temp
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/n/temp
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT stack01 ~
  $ cd o:

  Administrator AT stack01 /cygdrive/o
  $ cp m:/cyg.out .

  Administrator AT stack01 /cygdrive/o
  $ ls -l
  total 38
  -rw-r--r--    1 Administ None        37971 Oct  5 12:05 cyg.out

  Administrator AT stack01 /cygdrive/o
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/o
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/o
  $ cp cyg.out cyg.out.0

  Administrator AT stack01 /cygdrive/o
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT 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 AT 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 AT 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 AT 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 AT stack01 /cygdrive/o
  $ mkdir temp

  Administrator AT stack01 /cygdrive/o
  $ cd temp

  Administrator AT stack01 /cygdrive/o/temp
  $ cp ../cyg.out .

  Administrator AT stack01 /cygdrive/o/temp
  $ cp cyg.out cyg.out.0

  Administrator AT 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 AT stack01 /cygdrive/o/temp
  $ cp ../cyg.out .

  Administrator AT 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 AT stack01 /cygdrive/o/temp
  $ cd c:

  Administrator AT stack01 /cygdrive/c
  $ touch b

  Administrator AT stack01 /cygdrive/c
  $ cp b b.b

  Administrator AT 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 AT stack01 /cygdrive/c
  $ cp b b.b

  Administrator AT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019