delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/04/02/08:37:11

X-Spam-Check-By: sourceware.org
Message-ID: <442FC58A.4070707@roboros.com>
Date: Sun, 02 Apr 2006 14:37:30 +0200
From: =?ISO-8859-1?Q?Robert_=D6gren?= <lists AT roboros DOT com>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: popen() fails after 256 successful calls
References: <e0oel0$b4a$1 AT sea DOT gmane DOT org>
In-Reply-To: <e0oel0$b4a$1@sea.gmane.org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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

Eric Lilja wrote:
> Hello, I have two directories, both with ~4k files in them. For each 
> directory I needed to calculate a SHA1 checksum on each file and store them 
> in a table and then do some comparisons. I wrote a C++ program for this but 
> I noticed popen() (which I use to invoke sha1sum.exe to calculate the 
> checksum) would fail after 256 successful calls with the error "Resource 
> temporarily unavailable". I rewrote the program in pure C and kept just the 
> directory scanning/popen() part and tried a few directories but still the 
> same error. Attached is the source for the C program, Makefile to build it 
> and cygcheck output.

I believe you should use pclose, not fclose, to close the stream 
returned by popen.

Regards,
Robert

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