Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-Id: <200106281254.f5SCs4820618@pilot21.cl.msu.edu> Subject: system() not working as expected... To: cygwin AT sources DOT redhat DOT com Date: Thu, 28 Jun 2001 08:54:04 -0400 (EDT) From: "Brian Michael Genisio" X-Mailer: ELM [version 2.4 PL25] Content-Type: text/plain Hello, I am having the following problem... I am trying to port a program that uses the system call. It works fine if I call it from the cygwin environment's bash shell, but if I just run bash.exe from a dos prompt, and run the program, the system() call does not work. Here is an example : int main(void) { system("dir"); } If I compile and run from the bash command line, it works great. Next, on a clean system, I copy the sample program, bash.exe, dir.exe and cygwin1.dll to a directory, and run bash.exe. Now, I call the sample program, and it exits normally. My first thought was that stdout was not displaying correctly, so I tried : system("dir >junkfile") I got the same results... junkfile was created in the cygwin environment, and not in the raw bash environment. My next thought was that the paths were being confused somehow, so I tried compiling with system("$PWD/dir") and absolute paths... still, I get the same results. Any Ideas? Brian -- --------------------------- \\|// Brian Genisio (o o) genisiob AT pilot DOT msu DOT edu ~~oOOo~(_)~oOOo~~~~~~~~~~~~~~~~~~~~~~~~~~ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/