This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: system() call behaviour.
- To: paslawsk at cadvision dot com (Dan Paslawski)
- Subject: Re: system() call behaviour.
- From: newsham at lava dot net (Tim Newsham)
- Date: Fri, 8 May 1998 08:04:42 -1000 (HST)
- Cc: gnu-win32 at cygnus dot com, paslawsk at cadvision dot com
>
> 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
"gnu-win32-request@cygnus.com" with one line of text: "help".