[fpc-pascal]Possible bug in fsearch?

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


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;
     FileExist := fSearch (EFName, '') <> '';

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 
at the end, as I consider DOSError shouldn't be touched!


More information about the fpc-pascal mailing list