[fpc-pascal] FindFirst/FindNex question

Bart bartjunk64 at gmail.com
Sun Sep 13 17:22:59 CEST 2026


Hi,

Just curious.

Given a situation where FindFirst/FindNext returns 0 (=succes), under
which circumstance can the TSearchRec.Name become an empty string?

I'm asking because we have code in our codebase (fpc/lazarus) like:

=======
  if FindFirst(CurSrcDir+AllFilesMask,DeleteMask,FileInfo)=0 then
    Try
      repeat
        // check if special file
        if (FileInfo.Name='.') or (FileInfo.Name='..') or
(FileInfo.Name='') then
          continue;
========

Never saw that on Windows or Linux, but since fpc supports more
platforms, maybe some of them may return an ampty string for
TSearchRec.Name?

-- 
Bart


More information about the fpc-pascal mailing list