[fpc-pascal] DoDirSeparators and special filenames on Windows

Jürgen Hestermann juergen.hestermann at gmx.de
Tue Sep 10 17:35:55 CEST 2013


Am 2013-09-09 22:28, schrieb Tomas Hajny:
 > ...and the issue is that at least some Windows API functions happily accept such paths,
 > i.e. programs using such API functions accept them too.
 > If FPC RTL manages to "translate" a path accepted by Windows
 > (and other programs not compiled to FPC too) to something which is not accepted by
 > Windows (API) any longer, then we may consider fixing such "translation".


IMO, when a path contains two consecutive path delimiters then something is wrong.
It could also be that someone wanted to type a letter between both delimiters so dropping
one of them is trying to guess what the user wanted which leads to errors in most cases.
Suddenly a file or directory is accessed that was not meant by the user.
A path should be correct and no more or less smart second guessing should be done.
Otherwise you can also start a "nearest match" search that tries to find another directory
in case the specified one is not found. That's something I would expect in C but not in Pascal.
And even if the WinAPI allows such flaws I don't think that Pascal programmers like this too.




More information about the fpc-pascal mailing list