Op Wed, 3 Jan 2007, schreef Vincent Snijders:

> Henry Vermaak schreef:
> > Hi all
> > 
> > FileExists seems to be inconsistent between linux and windows.
> > FileExists in linux returns true for a directory, but not in windows.
> > The windows behaviour is consistent with Delphi, though, and I assume
> > that's correct.
> > 
> > Can anyone confirm or comment on this?
> > 
> 
> I can confirm this.

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.

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.

Daniël
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to