[fpc-pascal] Where does Write(Ln) actually write to?

Tomas Hajny XHajT03 at mbox.vol.cz
Tue May 12 13:01:56 CEST 2009


On Tue, May 12, 2009 05:38, leledumbo wrote:
> Jonas Maebe-2 wrote:
>>
>> It writes to whatever the text file variable called "stdout" in rtl/
>> inc/systemh.inc is assigned to. Standard I/O is indeed buffered, see
>> the routines in rtl/inc/text.inc. The actual writing from the buffer
>> to the associated file/device is done by FileWriteFunc(), which calls
>> Do_Write() (the latter is an OS-specific function that you have to
>> implement).
>>
>> Also note that if textrec.FlushFunc is nil, then write(ln) will not
>> automatically flush after each operation. As you can see in
>> FileOpenFunc(), it is only assigned in case Do_Isdevice() returns true
>> for the handle of the opened "file".
>
> Roger that, implementation begins...

I guess that you should have a look at some of the other Do_??? functions,
in particular Do_Open coming to my mind. Unfortunately, the description
for these functions in our Wiki
(http://wiki.freepascal.org/System_unit_structure) has not been finished
yet. :-(

Tomas





More information about the fpc-pascal mailing list