[fpc-pascal] DoDirSeparators and special filenames on Windows

Tomas Hajny XHajT03 at hajny.biz
Sun Sep 8 22:40:07 CEST 2013


On Sun, September 8, 2013 19:21, Bart wrote:
> On 9/8/13, Tomas Hajny <XHajT03 at hajny.biz> wrote:
 .
 .
>> Good, thanks for the pointer. We may indeed want to add some safeguards
>> to
>> the Windows GetDir implementation (or possibly check some alternative
>> solution for finding out the current directory on other drives).
>
> It may very well not be possible.
> The ugly truth ma be that we have to learn to live with it (it's been
> a long time since DOS).

This has nothing to do with time since DOS - someone designing the
Win32/64 apparently either decided not to cover all the Win32/64 features
(including those which were originally probably indeed added for DOS
compatibility like drive letters and current directories maintained in
parallel for different drives) within the provided API set, or simply
didn't realize that some features are not supported well by the provided
API.


>>  After all, it
>> means that not only ExpandFilename is not threadsafe, but basically any
>> opening of a file (and other I/O operations working with file names)
>> wouldn't be threadsafe either. We will have to solve it somehow.
>
> Removing Thread support would solve it definately ;-))

Indeed, and removing Win32 and Win64 support would solve it too. ;-)))


> It may be a good idea to document this somewhere (in the apprpriate
> sections about File IO as well as MultiThreading)?
> I mus admit, that at this point I was too lazy to look for that.3

Yes, documenting it is the minimum which should be done.

Tomas





More information about the fpc-pascal mailing list