This is the mail archive of the cygwin 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]
Other format: [Raw text]

Reg : System Command Not Working


Hi,

   We are migrating unix application to windows. We have converted
the Unix samp.sh file to samp.bat for windows.
   While converting samp.sh file we have used some unix command in
samp.bat file.We have installed SFU to support
   those unix command. We are using some cygwin exe also.We have
installed cygwin also. In my application we have
   one senario that one cpp file have system command, and we have
created exe with MSVC++. But when i run that exe
   I got the error message that "The system cannot execute the
specified program". Then I have created sample.exe which
   is having the system command. If i run the following senario it is working
   (1) Only SFU installed in Windows 2003 server
   (2) Only CYGWIN installed in Windows 2003 server
   (3) Without SFU and CYGWIN in Windows 2003 server
   My doubt is
   (i)If Cygwin and SFU was together, that time I can't execute the
system command? Why ?
   (ii) With cygwin only ( Without SFU) How we will make a grep
command to execute?

   Here is my sample code
   #include <stdio.h>
   #include <stdlib.h>

  int main ()
  {
   int i;
   printf ("Checking if processor is available...");
   if (system(NULL)) puts ("Ok");
   else exit (1);
   printf ("Executing command DIR...\n");
   i=system ("dir");
   printf ("The value returned was: %d.\n",i);
   return 0;
  }

  Pls help.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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