Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-09

Possible bug in fsearch?

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Aitor Santamaria Merino

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