[fpc-pascal] DoDirSeparators and special filenames on Windows

Bart bartjunk64 at gmail.com
Sat Sep 7 21:46:40 CEST 2013


On 9/7/13, Jürgen Hestermann <juergen.hestermann at gmx.de> wrote:

> Of course! Why the hell should there be double pathdelims? And why
> (silently) accept them as if they were one?

There should not be, but (history: DOS and) WinApi accept them, so the
are NOT illegal in normal filenames.


> '/' etc, because these are illegal
>  > characters in a filename on Windows.
>
> Illegal characters should be taken just like that: Illegal characters. Why
> should they be accepted/converted? Who adds illegal characters and expects
> them to be silently converted to something legal? Just the opposite.

They ('/','.') are only illegal in the '\\?\ scheme, they are
perfectly legal (but are converted by WinApi) in "normal" filenames.

>  > You would also not be able to open files with a relative path:

>  > (And in a threaded program you may not want to call ExpandFilename(),
>  > since on Windows this is not threadsafe).
>
> Then you only have the choice between relative paths working for long paths
> or threadsafe programs.


Well then, say goodbye to the Lazarus IDE, because we want and need both.
Mutatis mutandis for many real world programs out there, I guess.

Bart



More information about the fpc-pascal mailing list