[fpc-pascal]Possible bug in fsearch?

Aitor Santamaria Merino aitor.sm at terra.es
Sun Sep 23 01:48:58 CEST 2001


Hi!

I am using the following function for discovering wether a file exists
or not, as I think it's one of the fastest methods I can come up with:

FUNCTION FileExist (EFName : String): boolean;
BEGIN
     FileExist := fSearch (EFName, '') <> '';
END;

fsearch messes DOSError with 6 in FreePascal, but doesn't do so in
TurboPascal (DOSError=0). Ok, perhaps it has been yet fixed, as I am
still using an old release of FreePascal (planning to upgrade soon!),
but I let you know just in case it's a bug to be fixed. (I just recall
TP doc says 6='unknown media descriptor')

Personally, I have patched my function by adding 
DOSError:=0 
at the end, as I consider DOSError shouldn't be touched!

Aitor




More information about the fpc-pascal mailing list