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 From: "Dave Korn" To: , Subject: RE: cp.exe bug Date: Tue, 16 Mar 2004 18:17:06 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: <6C16F414.6D474E6E.6B9180F2@aol.com> Message-ID: X-OriginalArrivalTime: 16 Mar 2004 18:17:07.0203 (UTC) FILETIME=[E3FF4D30:01C40B82] > -----Original Message----- > From: cygwin-owner On Behalf Of LarrysPCRemedies AT aol DOT com > Sent: 16 March 2004 17:36 > I get the same error with mv.exe > > I have a Makefile with the following statement [snip] > all: mpget2decodes > mv -f mpeg2decode ../mpeg2decode > [/snip] > > Running make I get the following output (non-pertenant info > deleted) [snip] $ make ... > mv -f mpeg2decode ../mpeg2decode > mv: `mpeg2decode' and `../mpeg2decode' are the same file > make: *** [all] Error 1 > [/snip] > > I get the same error if I manually type the command. Seems strange! > > I've attached a copy of cygcheck -svr output. > > Any ideas? Update to a new/old cygwin? There's a few possibilities: #1) Fix the makefile. Suppose we were on a real *nix system: mv would complain that there's no such file as "mpeg2decode" if what was actually on your disk was called "mpeg2decode.exe". Make the makefile know that your file actually has a .exe extension, rather than relying on the builtin exe-to-non-exe-aliasing that cygwin does. You could always do something like... ----snip---- ifdef CYGWIN OUTFILE=mpeg2decode.exe else OUTFILE=mpeg2decode endif all: $(OUTFILE) mv -f $(OUTFILE) ../$(OUTFILE) $(OUTFILE): [other dependencies] gcc [object modules] [linker flags] -o OUTFILE ----snip---- i.e. explicitly specify the exe extension everywhere. Alternatively you could just add a line that said "-mv mpeg2decode.exe mpeg2decode" as part of the final link command: on *nix systems where the executable doesn't have the .exe extension, that command will silently fail without failing the make, and on cygwin systems it will rename the file to remove the extension allowing the rest of the makefile to work as usual. #2) Fix the compiler. It's easy enough to prevent gcc adding the .exe extension. It could be argued that if you tell gcc "-o foo", then the name of the output file should be "foo", not "foo.exe". Thing is, people want this functionality so that their exes run from a DOS prompt as well as a Bash shell. It's a shame there's no way currently to prevent the compiler from adding ".exe" when you really don't want it. #3) Fix the coreutils. Make them either better understand that foo and foo.exe are the same, or make them treat the two as completely different. Presumably this would require looking into for what reason and why the earlier code that did this was ripped out. #4) Just revert your coreutils. Didn't someone say it was working in the previous version? Then it should still be ok in most other regards..... cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/