Flush(StdOut) doesn't mean Flush(Output)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Flush(StdOut) doesn't mean Flush(Output)

leledumbo
Administrator
In the rtl documentation, StdOut is defined as an alias for Output. Therefore, (I think) flushing one will also flush the other. But the truth, it's not. In fact, only Flush(Output) will really flush standard output. So, what will Flush(StdOut) do?

PS: This might apply to StdErr (and StdIn, but I don't find StdIn), too.
Reply | Threaded
Open this post in threaded view
|

Re: Flush(StdOut) doesn't mean Flush(Output)

Tomas Hajny
On Mon, July 7, 2008 09:55, leledumbo wrote:
>
> In the rtl documentation, StdOut is defined as an alias for Output.
> Therefore, (I think) flushing one will also flush the other. But the
> truth,
> it's not. In fact, only Flush(Output) will really flush standard output.
> So,
> what will Flush(StdOut) do?

Obviously, it would flush everything written to StdOut file (which is
normally associated with the same system handle as Output, but treated as
a different file in our RTL).

You are absolutely right that our documentation is not aligned with the
current implementation. The question is, what we really want or need
(either side may be changed). Does anybody see particular benefits of the
current implementation (i.e. having two independent files for each of
stdout system handle and two independent files for stderr)?


> PS: This might apply to StdErr (and StdIn, but I don't find StdIn), too.

It would indeed apply to StdErr and ErrOutput too.

Tomas


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Flush(StdOut) doesn't mean Flush(Output)

leledumbo
Administrator
So, what's the purpose of having them?
Reply | Threaded
Open this post in threaded view
|

Re: Flush(StdOut) doesn't mean Flush(Output)

Tomas Hajny
On Mon, July 7, 2008 12:11, leledumbo wrote:
>
> So, what's the purpose of having them?

That's the part I could not answer myself and asked others who could
remember the reasons for introducing it. There may have been technical
reasons like support for "absolute" keyword (which could support a real
alias) missing with some targets/platforms, or some reasons why there
should be two distinct text files with their own buffers, possibly
different I/O handlers and using different output device/handle.

Tomas


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal