delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/03/24/12:35:02

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs
Date: Mon, 24 Mar 2003 12:33:50 -0500 (EST)
From: Igor Pechtchanski <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: Kodaj Bence <kodaj AT freemail DOT hu>
cc: cygwin AT cygwin DOT com
Subject: Re: Starting .exe: DOS prompt OK, double-click not
In-Reply-To: <freemail.20030224153505.81470@fm6.freemail.hu>
Message-ID: <Pine.GSO.4.44.0303241230040.561-100000@slinky.cs.nyu.edu>
Importance: Normal
MIME-Version: 1.0

On Mon, 24 Mar 2003, Kodaj Bence wrote:

> > > "/cygdrive/c/OurAppFolder/OurScript.tcl": no such file or directory
> >    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > This is a POSIX path.
> > You can translate it to a Windows path using the Cygwin API call
> > cygwin_conv_to_win32_path
>
> Thanks for the tip, but I'm not sure this is the solution. There's a point
> that I might not have made clear enough in my previous posting:
>
> =============================================
> Everything's fine when I start OurApp.exe from a DOS prompt.
> =============================================
>
> Now, OurApp.exe invokes wish like this:
>
>   execlp( "wish", "wish", "./OurScript.tcl" , ...);
>
> My question is: why does this call work in the "DOS-prompt mode", and
> why doesn't it work in "double-click mode"? Let me emphasize again
> that wish is invoked _in the same way_ in both cases.
>
> Bence Kodaj

Because from the DOS prompt your program is invoked as ".\OurApp.exe", and
from Explorer it's invoked with a full path (i.e.,
"C:\OurAppFolder\OurApp.exe").  Cygwin translates the current directory
into a POSIX path.  In the first case, the current directory is ".\",
which in POSIX is "./".  Now, since Windows understands mixed paths, it
interprets this correctly, so your program works.  In the second case, the
path becomes what you see in the error message above, which is not
understood by Windows.

I'm not sure how to avoid path translation.  You could try invoking wish
as
   execlp( "wish", "wish", "OurScript.tcl" , ...);
instead...
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
     |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Oh, boy, virtual memory! Now I'm gonna make myself a really *big* RAMdisk!
  -- /usr/games/fortune


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019