[Overview][Constants][Types][Procedures and functions][Variables][Index] Reference for unit 'Dos' (#rtl)


Dispose resources allocated by a FindFirst/FindNext sequence.


Source position: dosh.inc line 106

procedure FindClose(

  var f: SearchRec



FindClose frees any resources associated with the search record F.

This call is needed to free any internal resources allocated by the FindFirst or FindNext calls.

The Unix 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.

Remark: It is recommended to use the Linux call Glob when looking for files on Linux.


Errors are reported in DosError.

See also



Start search for one or more files.



Find next matching file after FindFirst

Documentation generated on: Jun 22 2020