[fpc-devel] Console IO revisited

Daniël Mantione daniel.mantione at freepascal.org
Fri Dec 3 16:24:14 CET 2010



Op Fri, 3 Dec 2010, schreef Thaddy:

> On 3-12-2010 15:50, Daniël Mantione wrote:
>> 
>> Could you maybe specify what you want to achieve and in what way FPC 
>> requires you to use workaround hacks?
>> 
>> Daniël
> Yes,
>
> In FPC the console IO is *always* redirected, be it through a handle or a 
> named file.

I don't understand what you mean here.

> The named file is expected to be independent of redirection. The handle not.
> Handle copying or inheritance doesn't matter in this case. The 'CONXXX' 
> should always point to one and the same.
> Without hacks this is not possible in the current implementation. CONXXX != 
> ( sorry, not) the vars Input, output etc.

Okay, so you are saying that an assign(input,'CONXXX') results into dual 
handles?

What is the reason you do not use the standard assign(input,''), to attach 
to stdio? I.e. is there a good reason why you are using CONXXX?

> At least in winapi speak. (or similar with Posix).

But Posix doesn't have a CONXXX equivalent?!

>And these refer to OS interfaces, not languages.
>
> But as I confess, I might be wrong. Show me.
>
> Michael has a point of view from the language perspective, which is 
> historically almost correct.
> My view is it has been superseded by OS's through history.
>
> Oh my, I just promised I consider the prevailing opinion as acceptable ;-)

I still would like to know what you are trying to achieve. You got closer, 
but I still don't get the reason why you want to work with CONXXX

Also, you understand that making stdio thread-safe without threadvars is a 
huge change that requires a lot of time investment?

Daniël


More information about the fpc-devel mailing list