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]

Re: Reg : System Command Not Working


On Mon, Jun 02, 2008 at 05:30:16PM +0530, Mani kandan wrote:
>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;
>  }

I don't understand why you wouldn't just use samp.sh unchanged from
Unix without changing it to a .bat file and use either product the way
it was designed without SFU with cygwin binaries or vice versa.

But, unless this is just a simple PATH environment variable problem, i'm
sorry, but we're really not going to be helping you debug problems with
a combination of both Cygwin and SFU.  They are competing products and
there really is no reason to use them in conjunction with each other.

cgf

--
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]