delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/05/09/02:20:59

From: newsham AT lava DOT net (Tim Newsham)
Subject: Re: system() call behaviour.
9 May 1998 02:20:59 -0700 :
Message-ID: <m0yXrVi-0011AsC.cygnus.gnu-win32@malasada.lava.net>
References: <01BD79A4 DOT 73339640 AT ts11ip130 DOT cadvision DOT com>
Mime-Version: 1.0
To: paslawsk AT cadvision DOT com (Dan Paslawski)
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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019