delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/06/02/08:00:47

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <182dc94a0806020500g2b8211d1w948a117b233c1fb1@mail.gmail.com>
Date: Mon, 2 Jun 2008 17:30:16 +0530
From: "Mani kandan" <kvmani76 AT gmail DOT com>
To: cygwin AT cygwin DOT com
Subject: Reg : System Command Not Working
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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/

- Raw text -


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