This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: PATHEXT is fundamental to Windows and Should be recognised by CYGWIN

On Tue, Aug 9, 2016 at 8:58 AM, cyg Simple wrote:
> I tried "chmod +x foo.txt; ./foo.txt" but that results in Cygwin
> assuming the text file is a script and executing each line of the file.
> If PATHEXT were used only to determine that the file should be passed to
> ShellExecute instead it might be beneficial but since I can easily just
> do "cmd /c foo.txt" then probably not so much.

That is the behavior I would expect in any *nix environment, and
therefore consider the correct behavior within cygwin.

Additionally, starting a text editor for foo.txt is not a function of
PATHEXT, but rather of file association.  In CMD.EXE,

C:\tmp>echo some text >foo.txt

'foo' is not recognized as an internal or external command,
operable program or batch file.

C:\tmp>echo echo some text >foo.cmd


C:\tmp>echo some text
some text


PATHEXT looks for *executable* files, not file association.  I warned
previously in this thread about getting the two confused.

-- Erik

Problem reports:
Unsubscribe info:

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