Subject: Re: system() call behaviour.
From: [email-masked] (Tim Newsham)

9 May 1998 02:20:59 -0700
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
To: [email-masked] (Dan Paslawski)
Cc: [email-masked], [email-masked]

> 
> I have an application which performs a sort on a datafile using system utilities
> (via the function "system()").
[..]

> When running this under the Cygwin Bash environment, this code works properly.  However,
> if I run the code in a Windows NT Command Prompt Window (or an MS_DOS Window under
> Windows 95),  the calls to system() fail.  I have also tried this segment of code with other 
> commands (eg. dir, copy, mspaint), with the same results.
> 
> Any suggestions?

system() invokes the shell to execute the command passed to it.
To support this you will have to have the shell in your path when
you run the binary.  If this is on the same machine, simply add
the directory with sh.exe to your path (or copy sh.exe to some
directory already in your path).  If you are shipping binaries to users 
who don't run cygwin, you will have to provide sh.exe in addition
to cygwinb19.dll and have both installed in a directory in the users
path.  Note: although DOS implicitely assumes the current directory
is in the path, cygwin does not.  You may want to explicitely add
the currect directory to the path from within your program if you
expect to run sh.exe from the current directory.

> Dan

                                           Tim N.

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