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

Martin Hankovec Martin.Hankovec at oku-st.cz
Wed Feb 14 09:05:35 CET 2001


Hello,
I've a problem:
I'm writing simple routine for copying files (it's in documentation too).

If the type of variable for statement 'assign' is TEXT - it's OK. 'Reset'
opens it, 'close' closes it even for many files.

 B U T 
If it's 'FILE' like in example in doc, and I try to copy more files, it crashes
on error - too much files are opened. And I use only Assign,Reset and Close!
So after 'close' on filetype 'FILE' it is still opened ?!!!

Fragment:
...
Var
    Fin,fout : text;
begin
  Assign (Fin,name);
  Reset(Fin);
 ....
  close (fin);  
end;

This works on many files OK. If I change it to
Fin,fout: file;
after 5 proofs it will crash (5 is the maximum of simultaniously opened files
under my Win NT)
I have the ver. 1.0.2 of compiler.

Can anybody tell me, how to copy many of files?

Thanks a lot and have a good day

Martin





More information about the fpc-pascal mailing list