[fpc-pascal] FileExists inconsistency

Henry Vermaak henry.vermaak at gmail.com
Wed Jan 3 16:41:05 CET 2007


> There is no getting away that Dos filesystem handling is different
> from Unix file handling. On Dos like platforms, a filename with
> a same name as a subdirectory can exist in the same directory. In other
> words, it should return false.
>

I cannot create a file with the same name as a subdir under Windows XP
on ntfs or fat32...

> On the other hand, in Unix, it should return true because otherwise code
> like:
>
> if not fileexists('abcd') then
>   begin
>     assign(f,'abcd');
>     rewrite(f);
>   end;
>
> ... becomes unreliable.
>

...so that means that this code will also be unreliable on windows.
In short: the 2 file systems are consistent with their behaviour in
this respect, but the FileExists is not.

Maybe there's something I'm missing?

Henry



More information about the fpc-pascal mailing list