delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/09/01:16:19

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
Message-ID: <416774BB.5020201@agilent.com>
Date: Fri, 08 Oct 2004 22:18:51 -0700
From: Earl Chew <earl_chew AT agilent DOT com>
User-Agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: mv: `Tcollect2' and `collect2' are the same file

I got this error trying to build gcc using cygwin 1.5.11. This problem
is easily reproduced:

X:> touch Tfoo.exe
X:> chmod a+rx Tfoo
X:> ls -l Tfoo
-rwxrwxrwx    1 earlch   mkpasswd        0 Oct  8 22:08 Tfoo
X:> mv Tfoo foo
mv: `Tfoo' and `foo' are the same file

Huh?

Digging deeper, I see that ls uses stat(), which eventually gets
to stat_worker() which uses build_fh_name() passing it the suffix
table:

suffix_info stat_suffixes[] =
{
   suffix_info ("", 1),
   suffix_info (".exe", 1),
   suffix_info (NULL)
};

The function build_fh_name() uses path_conv and gives it the suffix
table to use to find the target.

OTOH rename() goes straight to using path_conv without a suffix table,
and fails to find the file.

Should rename() pass stat_suffixes[] to the path_conv ctor?

Is there some subtle reason for suffixes only to be passed for stat()
processing?

Earl


--
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