next up previous contents index
Next: FindFirst Up: Functions and Procedures Previous: FExpand

FindClose

   

Declaration:

Procedure FindClose (Var F: SearchRec) ;

Description:

LINUX only Under LINUX, the findfirst/findnext calls have to be mimicked. An internal table of file descriptors is kept. When using different searchrecs at the same time, the system may run out of file descriptors for directories.

The LINUX implementation of the DOS unit therefore keeps a table of open directories, and when the table is full, closes one of the directories, and reopens another. This system is adequate but slow if you use a lot of searchrecs.

So, to speed up the findfirst/findnext system, the FindClose call was implemented. When you don't need a searchrec any more, you can tell this to the DOS unit by issuing a FindClose call. The directory which is kept open for this searchrec is then closed, and the table slot freed.

It is recommended to use the LINUX call Glob when looking for files.

Errors:

None.

See also:

Glob.



Michael Van Canneyt
Thu Sep 10 13:59:33 CEST 1998