Hint "?" Operator does not exist but there is a replacement:
if (ap^.ap_Info.fib_DirEntryType < 0) then begin s := ''; end else s := 'Dir';
one could write:
s := IfThen(ap^.ap_Info.fib_DirEntryType < 0, '', 'Dir')
(if for strings need Unit StrUtils, for number need unit Math)
Indeed, i 'missed' the ifthen solution. Something i came to learn about a little later on. fwiw: i initially used my own iif routines, but ripped them out for this routine to not confuse the reader (in original a-e post).
Sorry for the 'simple' copy-paste. I'll try adding explanations later on. Which btw will also handle the topic of why this recursive search does not call itself recursively (i can't help commodore invented 'dumbwitted' OS calls that does things automatically for us ;-p).
I'll add the Freepascal native counterpart alongside as well to compare/explain.