cygwin python.exe symlink breaks when called from .bat file

G

gry

[Windows XP Pro, cygwin python 2.4]

Under cygwin, the python executable is installed as python2.4.exe with
a
symbolic link to python.exe. This is fine as long as one is operating
only
withing the cygwin world. But I execute python from a foo.bat file,
and
windows barfs on the symbolic link. I replaced it with a hard link and
all
is well. Is there some reason this shouldn't be the standard
installation
under cygwin?
 
J

Jason Tishler

Under cygwin, the python executable is installed as python2.4.exe with
a symbolic link to python.exe. This is fine as long as one is
operating only withing the cygwin world. But I execute python from a
foo.bat file, and windows barfs on the symbolic link.

You can always do the following as a workaround:

C:\> bash -c python
I replaced it with a hard link and all is well.

Note the above will only work as a true hard link under NTFS. IMO, the
above is a better approach.
Is there some reason this shouldn't be the standard installation under
cygwin?

Because it would require (more) modification of the Unix build to
accommodate Windows. IMO, it is not worth the effort. If you feel
differently, then submit a patch for consideration:

http://sf.net/tracker/?func=add&group_id=5470&atid=305470

BTW, many other Cygwin commands have this issue too:

$ find /bin -type l -name '*.exe'
/bin/awk.exe
/bin/c++.exe
/bin/captoinfo.exe
/bin/cc.exe
...

Jason
 
J

Jason Tishler

George,

Please keep your replies on-list.

Hmm, that's fine for typing a command interactively, but try fitting
it into a DOS "ftype" command so that double-clicking a .py file gets
the right thing with the right args -- nasty, I couldn't get it to
work.

Since you are looking for tight integration with Windows, maybe you
should use Win32 Python?
I'll try that... maybe I can light a fire.

Jason
 
D

Daniel Dittmar

[Windows XP Pro, cygwin python 2.4]

Under cygwin, the python executable is installed as python2.4.exe with
a
symbolic link to python.exe. This is fine as long as one is operating
only
withing the cygwin world. But I execute python from a foo.bat file,
and
windows barfs on the symbolic link. I replaced it with a hard link and
all

You could rename the symbolic link python.exe to python. Bash finds it
anyway and cmd.exe will it ignore it. Several of the symbolic links are
created without .exe by the installation.

If you really want to use cygwin-Python from cmd.exe, use doskey to
create an alias or create a batch file.
> is well. Is there some reason this shouldn't be the standard
> installation
> under cygwin?

Hard links are available only with NTFS volumes. (OK, you could create a
hard link with FAT*, but chkdsk will complain.)

Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top