X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: Yes, hits=5.8 required=5.0 tests=BAYES_50,BOTNET,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Message-id: <4E2089CB.4090608@valdetaro.com> Date: Fri, 15 Jul 2011 13:41:15 -0500 From: Luiz Claudio Valdetaro User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-version: 1.0 To: cygwin AT cygwin DOT com Subject: popen () fails when running from the windows prompt Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com i, I am planning a minimalistic installation of my application using cygwin. Everything works fine, except that popen() fails when running from the windows prompt. If I ran from the bash shell prompt of cygwin , it works fine. It is the only api I use that is failing. I created a simple, test program to narrow the issue, and it also fails. my intention is an installation with just my app, plus the cygwin.dll, as little files as possible. This is my test program: main (argc,argv) int argc; unsigned char *argv[]; { FILE *f; char command[80]="ls -l CGI-BIN"; char response[200]; f = popen (command,"r"); if (f == NULL) { puts ("stream error"); exit (0); } while (fgets(response,199,f) != NULL) { puts (response); } fclose (f); } The program allays fails printing "stream error" I guess that might be some additional setup I'm missing, such as environment variables? I apreciate any help you guys can give. Thanks, Luiz -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple