This is the mail archive of the 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: Starting .exe: DOS prompt OK, double-click not

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
   execlp( "wish", "wish", "OurScript.tcl" , ...);
      |\      _,,,---,,_		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:
Bug reporting:

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