Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Reply-To: Cygwin List Message-Id: <6.1.0.6.0.20040806115419.033a5168@pop.prospeed.net> X-Sender: Date: Fri, 06 Aug 2004 12:01:04 -0400 To: "ErWagner" , cygwin AT cygwin DOT com From: Larry Hall Subject: Re: BUG: 'cp -f ...' create a dir instead of a copy of a file! In-Reply-To: References: <6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040806090619 DOT 0330a470 AT pop DOT prospeed DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" At 11:41 AM 8/6/2004, you wrote: >"Larry Hall" schrieb im >Newsbeitrag news:6 DOT 1 DOT 0 DOT 6 DOT 0 DOT 20040806090619 DOT 0330a470 AT bop DOT bam DOT bin... >> At 07:23 AM 8/6/2004, you wrote: >> >My actual revision Cygwin runs under >> >Windows NT Ver 4.0 Build 1381 Service Pack 6 >> >shell: BASH 2.05b >> > >> >cp doesn't work correct >> >if the destination file do not exist the result is what I expect >> > >> ># result if y.log do not exist >> >$ cp -f x.log y.log >> >$ ls >> >-rw-rw-rw- 1 ???????? ???????? 30 Aug 4 18:14 y.log >> > >> ># result if y.log already exist! >> >$ cp -f x.log y.log >> >cp: overwrite `y.log'? y >> >cp: writing `y.log': Invalid request code >> >$ ls >> >drwxrwxrwx+ 2 ???????? ???????? 0 Aug 4 18:13 y.log/ >> > >> ># this works fine >> >$ cp --remove-destination x.log y.log >> >> >> Seems to me you 'cp' is not what you think. The procedure you outlined >> above works fine for me (on W2K). Given that you're being prompted in >> the overwrite case, I can only assume that your 'cp' is aliased to 'cp -i' >> or something. If that's the case, I'm wondering what else about the >> command is not as expected in your environment. If you're looking for >> the "quick resolution", I suggest you add in the '-v' flag and see what >> it tells you. I would also get rid of any alias, cover script, or what- >> have-you. Running this all under 'strace' might give you some clue, >> assuming you're running the Cygwin 'cp' (which is another good thing to >> check). If you're still having problems after all this, please visit, >> read, and follow . This has guidelines >> for required and requested info when reporting problems. It's clear that >> things on your system aren't entirely correct given the fact that none of >> your files have owners and groups that can be displayed. This could be >> related to the problems you're having with 'cp'. >> >> >> -- >> Larry Hall http://www.rfk.com >> RFK Partners, Inc. (508) 893-9779 - RFK Office >> 838 Washington Street (508) 893-9889 - FAX >> Holliston, MA 01746 >> >> > >On my Win2k PC the command 'cp' works fine. It overwrigts the destination >file correctly. >But NOT on The WinNT 4.0 SP6 PC!!! > >I used 'strace -o cp2.log cp -f -v x.log y.log' for more information and >found that cp will open an file named "y.log/x.log" (see attached log-file) >not so in the Win2k. So it does. Strange. Well, this may require some debugging on your part. I'm not clear whether your system differences/configuration aren't contributing/causing this problem. In any case, at least for the moment, I can't even try to reproduce the problem as I have no access to NT 4. If I can remedy that, I'll try it myself. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 838 Washington Street (508) 893-9889 - FAX Holliston, MA 01746 -- 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/