Mail Archives: cygwin-apps/2000/07/16/00:38:43
On Sun, Jul 16, 2000 at 02:26:50PM +1000, Robert Collins wrote:
>Sorry, I should explain more
>exec("C:\\cygwin\usr\local\program.exe") works (\\ c-style escaped)
>and program.exe receives the first format from start|run, and from
>shortcuts, or double-clicking on a program. So having a program that calls
>exec based in it's own path will need an library call equivalent to
>cygpath -u (which looks to be cygwin_conv_to_posix_path(name,
>convertedname), or for argv to be a little more consistent.
'exec' is not a cygwin function. Maybe this function is having problems
with the path that you are specifying above.
The 'exec[lv]*' family of functions should (and as far as I can tell,
do) operate correctly with any valid windows or cygwin path.
The short program below illustrates this:
main (int argc, char **argv)
fprintf (stderr, "argv '%s', argv '%s'\n", argv, argv);
execl (argv, argv + 2);
When I run this from Start->Run I notice that argv has quotes around
it, unlike what happens when running from the command shell. Cygwin was
preserving the quotes and that thwarts its later attempt to translate
the windows path version of argv into a posix path. I've checked in
a change to cygwin to cause it to strip the quotes from argv.
So, I'm not sure why you are having problems running the
c:/cygwin/usr/local/program.exe. It works for me, and I would expect
that it would.
>I've put cygwin_conv_to_posix_path in the program I'm working on, All i'm
>saying is that a longer term solution might be to put something in the
>----- Original Message -----
>From: "Chris Faylor" <cgf AT cygnus DOT com>
>To: "cygapp" <cygwin-apps AT sourceware DOT cygnus DOT com>
>Sent: Sunday, July 16, 2000 1:45 PM
>Subject: Re: two questions
>> On Sun, Jul 16, 2000 at 01:45:56PM +1000, Robert Collins wrote:
>> >1)Start|run, c:\cygwin\usr\local\program.exe
>> >2)start|run, cmd (running win2k). then (from any drive)
>> >in 1, argv is C:/cygwin/usr/local/program.exe
>> >in 2, argv is /usr/local/program.exe
>> >Note that bash was not the shell in 2! I'm quite happy to code around
>> >myself, but if someone wanted to provide a pointer as to where I should
>> >place it I'm happy to code around it for cygwin..
>> >The reason it's a issue, is that I want to call
>> >which the above behaviour scuttles..
cgf AT cygnus DOT com Cygnus Solutions, a Red Hat company
- Raw text -