Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > cygwin python.exe symlink breaks when called from .bat file

Reply
Thread Tools

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

 
 
gry@ll.mit.edu
Guest
Posts: n/a
 
      12-15-2004
[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?

 
Reply With Quote
 
 
 
 
Jason Tishler
Guest
Posts: n/a
 
      12-15-2004
On Wed, Dec 15, 2004 at 07:21:31AM -0800, gry wrote:
> 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&grou...70&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

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
 
Reply With Quote
 
 
 
 
Jason Tishler
Guest
Posts: n/a
 
      12-16-2004
George,

Please keep your replies on-list.

On Wed, Dec 15, 2004 at 01:36:03PM -0500, george young wrote:
> On Wed, 15 Dec 2004 10:56:17 -0500
> Jason Tishler <(E-Mail Removed)> threw this fish to the penguins:
> > On Wed, Dec 15, 2004 at 07:21:31AM -0800, gry wrote:
> > > 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

>
> 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 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&grou...70&atid=305470

>
> I'll try that... maybe I can light a fire.
>
> > 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

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D 8784 1AFD E4CC ECF4 8EF6
 
Reply With Quote
 
Fredrik Lundh
Guest
Posts: n/a
 
      12-16-2004
Jason Tishler wrote:

>> > You can always do the following as a workaround:
>> >
>> > C:\> bash -c python

>>
>> 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 don't use Cygwin myself, but several Cygwin users have told me that
exemaker has been immensely useful for them:

http://effbot.org/zone/exemaker.htm

</F>



 
Reply With Quote
 
Daniel Dittmar
Guest
Posts: n/a
 
      12-16-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> [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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find out the name of a user, on a given file/dir/symlink? Marc Heiler Ruby 4 06-10-2009 11:43 AM
Checking if the file is a symlink fails saswat@gmail.com Python 4 08-29-2008 08:16 AM
WELCOME to cygwin@cygwin.com cygwin-help@cygwin.com Python 1 09-05-2003 07:46 AM
confirm unsubscribe from cygwin-announce@cygwin.com cygwin-announce-help@cygwin.com Python 0 09-05-2003 01:29 AM
confirm unsubscribe from cygwin@cygwin.com cygwin-help@cygwin.com Python 0 09-04-2003 06:34 PM



Advertisments