[fpc-pascal] FPC docs about FindFirst

Ralf Quint freedos.la at gmail.com
Tue Sep 24 18:57:41 CEST 2019

On 9/24/2019 12:24 AM, Marco van de Voort wrote:
> Op 2019-09-24 om 03:03 schreef Ralf Quint:
>> systutils, so having documentation that includes the differences 
>> between the versions would be helpful.
>> Turbo Pascal (for DOS) didn't have a FindClose function, as 
>> "officially", this would not be necessary on DOS. On all other OS, 
>> including Windows, for many, many years (I first stumbled about 
>> missing "FindClose" call in OS/2 some time in the early '90s) and got 
>> used to *alway**s* terminate a file search with it, even if it is in 
>> the case of DOS just a dummy routine that just returns without doing 
>> nothing. Saves a lot of headaches trying to find the source of 
>> apparent memory leaks in larger applications that do a lot of of file 
>> searches...
> Note that afaik Long File Name supporting versions of the Dos unit 
> with Turbo Pascal did have findclose, as afaik the LFN apis required 
> it too.
> _______________________________________________ 

I don't recall that there was a "DOS" unit in Turbo Pascal that was LFN 
aware, at least not as part of an official Borland distribution up to 
Borland Pascal Professional 7.01, the last version that I bought way 
back then. I just checked the Reference Manual... ;-)

I have personally never cared about LFN in pure DOS, don't know if it 
was maybe part of Borland Pascal for Windows or in Delphi 1.02, but I 
think FindClose was part of Delphi 3, which I didn't buy until I moved 
to the US and then used on Windows 95 and NT 4. Checking RBIL states 
that FindClose is an INT21h function required for Long Filenames 
(AX=71A1h) but "this function is only available when IFSMgr is running, 
not under bare MS-DOS 7"

I now remember that I stumbled across the FindClose issue when running a 
BP7 program in an OS/2 DOS box, rather than true OS/2 program. And that 
I found the reason/solution in a Beta (alpha?) version of Metrowerks 
Codewarrior for OS/2, which I had access to for a while (to bad that 
that never got officially released, it would have given Borland a run 
for their money)...

This email has been checked for viruses by Avast antivirus software.

More information about the fpc-pascal mailing list