Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Pascal Borland > FreePascal - Fi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 7 Topic 1027 of 1102
Post > Topic >>

FreePascal - FindFirst and I/O Handles Used

by Jim Bishop <bishopjp@[EMAIL PROTECTED] > May 4, 2007 at 02:01 PM

I'm looping through several text files in a cgi-bin program of mine to 
accumulate sales data using FreePascal version 2.0.4.

To see if a file exists, I use FindFirst along with the DosError 
variable.  My cgi-bin crashes (with a 1450 error says the Apache error 
log) when looping through a large number of files, but not when looping 
through a small number of files.

I became suspicious of the FindFirst procedure in FreePascal and wrote a 
test program.

If I open Task Manager and look at the number of I/O handles in use 
while the program executes (under the Performance tab), the number grows 
until the program ends, but only if the file exists.  If the file does 
not exist, a number of handles does not grow large (interesting).

Is this a compiler bug?  Configuration bug? HW bug?  Or how can I free a 
handle that FindFirst apparantly uses?  Workarounds?

Thanks.

Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PROGRAM t2;

USES dos;

VAR
   i : longint;
   DirInfo : searchRec;

BEGIN {t2}
   FOR i:=1 to 500000 DO
     BEGIN
       findFirst('\VER.TXT',anyfile,dirinfo);
{file must exist - missing files do not show the problem}
       IF (i mod 1000)=0 THEN
         writeln(i);
     END; {endfor}

END. {t2}




 7 Posts in Topic:
FreePascal - FindFirst and I/O Handles Used
Jim Bishop <bishopjp@[  2007-05-04 14:01:22 
Re: FreePascal - FindFirst and I/O Handles Used
Marco van de Voort <ma  2007-05-04 19:29:47 
Re: FreePascal - FindFirst and I/O Handles Used
Jim Bishop <bishopjp@[  2007-05-05 01:16:13 
Re: FreePascal - FindFirst and I/O Handles Used
Marco van de Voort <ma  2007-05-05 10:04:46 
Re: FreePascal - FindFirst and I/O Handles Used
Jim Bishop <bishopjp@[  2007-05-05 12:04:31 
Re: FreePascal - FindFirst and I/O Handles Used
Marco van de Voort <ma  2007-05-05 14:00:22 
Re: FreePascal - FindFirst and I/O Handles Used
Jonas Maebe <Jonas.Mae  2007-05-07 11:00:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 1:01:27 CDT 2008.