This is the mail archive of the cygwin@sourceware.cygnus.com 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]

Re: system() call behaviour.


> 
> 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".


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