This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

lstat() and implied .exe extension



I have a question about a recent change to stat_worker():

    Sat Mar 25 20:46:39 2000  Christopher Faylor <cgf@cygnus.com>

	* syscalls.cc (stat_worker): Use extension search mechanism in
	path_conv to look for .exe rather than trying to special case it
here.

Before this change, an lstat() would more or less transparently add a
.exe extension to a symlink'ed file:

	ln -s /bin/cat.exe
	ls -l cat.exe
	lrwxrwxrwx   1 fifere   SIL_Equi       23 Apr 12 18:56 cat.exe ->
/bin/cat.exe
	ls -l cat
	-rwxrwxrwx   1 fifere   SIL_Equi       23 Apr 12 18:56 cat

I say "more or less" because the non-exe version is considered a regular
file.
I assume in part this was done because ls ordinarily does a lstat() and if
the file is a symlink follows up with a readlink(), and readlink() will not
imply a .exe.

After the change, lstat() does not imply a .exe:

	ls -l cat
	ls: cat: No such file or directory

This isn't a big deal, but I was surprised by the change in behavior
and thought I should ask whether the impact was anticipated.

Thanks,

Eric Fifer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]