Subject: RE: Exec/spawn outside of cygnus environment?
From: [email-masked] (Peter Mularski)

9 Jul 1998 00:49:58 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: <[email-masked]>, <[email-masked]>

Following is the code that I'm trying to use -- neither the system call nor
the execv calls will work outside of the cygwin environment -- they all
return "bad command or filename", although the directory that the program is
run from (d:\tlserve\exectest) does contain the 'hello2.bat' batch file.
within the cygwin environment, the system call and the first execv call
execute correctly, as they are expected to. I can compile this in Visual C++
5.0 and it will run correctly from the dos end, so I think it has something
to do with the cygwin DLL file (I am using b19.1, by the way). Any
suggestions?

Peter Mularski
CLARiiON

-------

#include <errno.h>
#include <process.h>
#include <stdio.h>

int main (int argc, char *argv[])
{
	char *cmdList[2];

	printf ("Running dir\n");

	cmdList[0]=	"dir";
	cmdList[1]=	NULL;
	system (cmdList[0]);

	cmdList[0]=	"./hello2.bat";
	cmdList[1]=	NULL;

	execv (cmdList[0], cmdList);
	perror ("Error");

	cmdList[0]=	".\\hello2.bat";
	cmdList[1]=	NULL;

	execv (cmdList[0], cmdList);
	perror ("Error");

	cmdList[0]=	"hello2.bat";
	cmdList[1]=	NULL;

	execv ("d:\\tlserve\\exectest\\hello2.bat", cmdList);
	perror ("Error");

	cmdList[0]=	"hello2";
	cmdList[1]=	NULL;

	execv (cmdList[0], cmdList);
	perror ("Error");

	return (0);
}

> -----Original Message-----
> From: Earnie Boyd [mailto:[email-masked]]
> Sent: Tuesday, July 07, 1998 8:33 AM
> To: Peter Mularski; [email-masked]
> Subject: Re: Exec/spawn outside of cygnus environment?
>
>
> The MSDOS shell will not understand any cygwin mounted paths you must
> specify the physical path.  Also the //D/ drive letter notation will
> not work under MSDOS.
>
> If this doesn't fit your problem, send a sample of what your trying to
> do.
>
> ---Peter Mularski <[email-masked]> wrote:
> >
> > Hello,
> >
> > I have been trying to use execv/spawnv outside of the cygnus
> environment
> > (e.g. via the cygwinb19.dll). My exec/spawn calls run fine within
> the cygnus
> > environment, but outside of the environment, windows returns a 'bad
> command
> > or filename'. I have tried both '/' and '\' for path specifiers, and
> nothing
> > will seem to work! Anyone had any experience with this? Other than
> that,
> > cygwin is fantastic!
> >
> > Peter Mularski
> >
> > -
> > For help on using this list (especially unsubscribing), send a
> message to
> > "[email-masked]" with one line of text: "help".
> >
>
> -        \\||//
> ---o0O0--Earnie--0O0o----
> [email-masked]
> ------ooo0O--O0ooo-------
>
> Please, research your question via the Searchable Mail Archives first.
> http://www.cygnus.com/ml/gnu-win32          (Searchable Mail Archives)
>
> Check out these great gnu-win32 related sites:
> ftp://ftp.cygnus.com/pub/gnu-win32/latest/                  (ftp site)
> http://www.cygnus.com/pubs/gnupro/                    (Comercial Page)
> http://www.cygnus.com/misc/gnu-win32/                   (Project Page)
> http://dvpraktikum.informatik.uni-koeln.de:3232/
>                                             (Cygwin32 Porting Project)
> http://www.lexa.ru/sos                               (Sergey Okhapkin)
> ftp://www.lexa.ru/pub/domestic/sos/                (Sergey's ftp site)
> http://www.fu.is.saga-u.ac.jp/~colin/gcc.html (Colin Peters - Mingw32)
> http://www.xraylith.wisc.edu/~khan/software/gnu-win32/    (Mumit Khan)
> ftp://ftp.hksys.com/pub/mirrors/EGCS-Win32/   (Jeremy Bettis - mirror)
> http://gnu-win32.paranoia.ru                   (Chuck Bogorad's ports)
> http://www.downloadwizard.com/ak/gnu-win32/bash.html
>                                         (GNU-Win32 Bash Configuration)
> http://www.parallax.co.uk/~andyp/index_text.html  (Andy Piper - ports)
> http://www.tiac.net/users/cgf     (Christopher Faylor - package ports)
> http://aquarius.franken.de/docs/develop/gnuwin32/GNUWin32.txt
>                                                (Package Porting Notes)
> ftp://ftp.franken.de/pub/win32/develop/gnuwin32/cygwin32/
>                                                        (German mirror)
> http://www.dol.ru/users/valtul      (Valery Tulnikov - software ports)
> ftp://ftp.cs.nyu.edu/pub/local/fox/cygwin32 (David fox - RPM packages)
> http://www.itribe.net/virtunix/winhelp-man-pages/     (HTML Man Pages)
> http://www.kedemel.demon.co.uk/                       (Darren's ports)
>
> Help for Win32 Beginners:
>  http://www.relisoft.com
>  http://www.program.com/resources/win32.html
>
> DISCLAIMER: These links or links from these pages to other sites do
> not constitute an endorsement of any entities, advertisers, products
> or services therein. I am not responsible for and do not control or
> monitor the content of these sites or the accuracy of information
> found therein.
>
> -------------------- IMPORTANT UPGRADE NOTICE ------------------------
> You should get the following to update your cygwinb19 package:
>
> Sergey Okhapkin's coolview package which contains an updated
> cygwinb19.dll.  (Yes, even if you've already downloaded the b19.1
> update from the Cygnus Site).
>
> Mumit Khan's compilation of EGCS for the cygwinb19.dll; especially if
> you're using the C++ compiler.  The current version of the compiler
> that
> comes with the tools has lots of problems that have been fixed with
> the EGCS version.  This is a drop-in replacement for the GCC toolset.
>
> URL's are listed above.
> -----------------------------------------------------------------------
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
>

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".