no, the problem is the 3rd assign.
fa has not to be initialized.
if i compile he makes no problem at 1st and 2nd assign.
Find.WinFindData.cFileName is for the long names.
The DOS searchrecord
does not support long filenames. Never has.
Either you use my code or you need to rewrite the application such that it uses the low level windows search API.
Btw, that is the only place your effort errs, nothing to do with the file handles.
To put it simple: the dos unit is not for windows and it is made invisible for windows.
That old TP code may compile on windows but not with long filenames. For that, the more "modern" file search API is needed (well that is "only" 35 years old, 1990) as is implemented in sysutils.