popen() fails after 256 successful calls

Robert Ögren lists@roboros.com
Sun Apr 2 12:37:00 GMT 2006


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/



More information about the Cygwin mailing list