[fpc-pascal]How to assign a file? Please help

Marco van de Voort marcov at stack.nl
Wed Feb 14 16:16:38 CET 2001


> ...
> procedure test(name:string);
> var fin:file;
> begin
>   assign(fin,name);  {assign it}
>   reset(fin,1);   {open for reading}
>   if ioresult<>0 then writeln('Error!!');
>   close(fin);     {do nothing and close it immediately}
> end;
> ...
> And call this procedure on many files. After some openings it returns an error
> (Too many files opened).
> 
> With Sysutils (fileread,fileopen etc.) it works, maybe an error in System unit ?

Do you do a recursive search with findfirst in the code that calls the above
procedure? If so, are all findfirst matched with a findclose?




More information about the fpc-pascal mailing list