Tue Mar 2 20:53:00 GMT 2010
On Mar 2 15:35, Christopher Faylor wrote:
> On Tue, Mar 02, 2010 at 09:32:56PM +0100, Corinna Vinschen wrote:
> >On Mar 2 15:17, Christopher Faylor wrote:
> >> On Tue, Mar 02, 2010 at 01:12:47PM -0700, Eric Blake wrote:
> >> >According to Corinna Vinschen on 3/2/2010 12:41 PM:
> >> >>>> should create "bar.exe" only if "foo" really resolved to "foo.exe" to
> >> >>>> begin with? In other words, what is the use case where someone wants
> >> >>>> "foo" to become "bar.exe", but "foo.exe" did not exist, and they called
> >> >>>> rename("foo","bar") instead of rename("foo","bar.exe")?
> >> >>>
> >> >>> I thought the idea is that bar becomes bar.exe if we know that foo is
> >> >>> really a PE-COFF binary.
> >> >>
> >> >> That's what `strip foo' does. It creates a temp file, writes the
> >> >> stripped content of the executable into the temp file, removes the
> >> >> original and then calls rename(temp_filename, "foo"). That's the
> >> >> most common situation which (well...) requires to append the .exe
> >> >> suffix automatically.
> >> >
> >> >Would it be easier to teach strip to always append .exe, seeing as how
> >> >that is a program that KNOWS it will be dealing with PE-COFF files?
> >> Sure, if we decided that this was the best way to handle this.
> >IIUC the idea is to drop the entire .exe appending from rename, right?
> >If so, we have to do all that .exe magic in mv(1) again, too.
> >There's also install(1) which just "forgets" to append a .exe to
> >installed executables if the -s option isn't given. I think this is
> >because install just copies and only the integrated strip call performs
> >the rename which automagically appends the .exe suffix. It would be
> >nice if that could be fixed somehow as well, while we're at it.
> So, the question is which approach solves the most problems? It sounds
> to me like maybe subversion is the exception rather than the rule here
> but I could be wrong.
If I could just answer the question... Honestly, I don't know. I never
had problems with the rename() function but maybe this only shows in
which limited scenarios that function is used in my daily work.
So, maybe we should just add an cygwin_internal hook for now which allows
to disable .exe appending?
Eric, I would like to hear your opinion as well. As coreutils
maintainer this entire rename(2) thingy affects you probably more than
any other package maintainer.
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
More information about the Cygwin-developers