Re: [fpc-pascal] Unbuffering I/O

2018-08-30 Thread Mark Morgan Lloyd
On 30/08/18 12:00, Henry Vermaak wrote: On Thu, Aug 30, 2018 at 10:57:21AM +, Mark Morgan Lloyd wrote:> Ah yes, that's it, thanks very much.> > WriteLn(StdErr, Format('# Socket %s, clock resolution %8.6f uSec',> [socketName, ts.tv_nsec / 1000]));> ttextrec(StdErr).flushfunc:= ttex

Re: [fpc-pascal] Unbuffering I/O

2018-08-30 Thread Henry Vermaak
On Thu, Aug 30, 2018 at 10:57:21AM +, Mark Morgan Lloyd wrote: > Ah yes, that's it, thanks very much. > > WriteLn(StdErr, Format('# Socket %s, clock resolution %8.6f uSec', > [socketName, ts.tv_nsec / 1000])); > ttextrec(StdErr).flushfunc:= ttextrec(StdErr).inoutfunc; > while tru

Re: [fpc-pascal] Unbuffering I/O

2018-08-30 Thread Mark Morgan Lloyd
On 30/08/18 10:15, Henry Vermaak wrote: On Thu, Aug 30, 2018 at 09:45:00AM +, Mark Morgan Lloyd wrote:> On 30/08/18 09:00, Henry Vermaak wrote:> >On Thu, Aug 30, 2018 at 07:52:54AM +0200, Martin Schreiber wrote:> > >In order to flush textfiles automatically I use> "> ttextrec().flushfunc:=

Re: [fpc-pascal] Unbuffering I/O

2018-08-30 Thread Henry Vermaak
On Thu, Aug 30, 2018 at 09:45:00AM +, Mark Morgan Lloyd wrote: > On 30/08/18 09:00, Henry Vermaak wrote: > >On Thu, Aug 30, 2018 at 07:52:54AM +0200, Martin Schreiber wrote: > > >In order to flush textfiles automatically I use> "> > >ttextrec().flushfunc:= ttextrec().inoutfunc;> "> after it

Re: [fpc-pascal] Unbuffering I/O

2018-08-30 Thread Mark Morgan Lloyd
On 30/08/18 09:00, Henry Vermaak wrote: On Thu, Aug 30, 2018 at 07:52:54AM +0200, Martin Schreiber wrote: In order to flush textfiles automatically I use> "> ttextrec().flushfunc:= ttextrec().inoutfunc;> "> after it is opened. Reading text.inc this morning lead me to believe this is the c

Re: [fpc-pascal] Unbuffering I/O

2018-08-30 Thread Henry Vermaak
On Thu, Aug 30, 2018 at 07:52:54AM +0200, Martin Schreiber wrote: > On Wednesday 29 August 2018 17:01:54 Mark Morgan Lloyd wrote: > > I think I've seen this question asked before, my apologies if this was > > recently. > > > > I've got two programs intended to be functionally identical, one in Perl

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread Marc Santhoff
On Wed, 2018-08-29 at 15:01 +, Mark Morgan Lloyd wrote: > I've got two programs intended to be functionally identical, one in Perl > and the other in FPC. They read a unix-domain datagram, decode the > message, and emit output; if this goes to a file then it's reasonable to > monitor it usi

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread Martin Schreiber
On Wednesday 29 August 2018 17:01:54 Mark Morgan Lloyd wrote: > I think I've seen this question asked before, my apologies if this was > recently. > > I've got two programs intended to be functionally identical, one in Perl > and the other in FPC. They read a unix-domain datagram, decode the > mess

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread wkitty42
On 08/29/2018 11:49 AM, Henry Vermaak wrote: Otherwise you'll have to Flush() them manually, which is a pain. really? i wrote a wrapper for write and writeln that simply calls them and then does a flush()... nothing painful other than using mywrite() and mywriteln() or similar ;) -- NOTE:

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread wkitty42
On 08/29/2018 11:01 AM, Mark Morgan Lloyd wrote: Is there an equivalent for Pascal, or should I be using something like fpSync(stdout) at opportune times? flush(); i use it all the time on my programs that write to the logs... i hate having a crash and be missing some log output because it w

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread Sven Barth via fpc-pascal
Am 29.08.2018 um 18:25 schrieb Mark Morgan Lloyd: On 29/08/18 16:00, Henry Vermaak wrote: On Wed, Aug 29, 2018 at 03:01:54PM +, Mark Morgan Lloyd wrote:> I think I've seen this question asked before, my apologies if this was> recently.> > I've got two programs intended to be functionally i

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread Mark Morgan Lloyd
On 29/08/18 16:00, Henry Vermaak wrote: On Wed, Aug 29, 2018 at 03:01:54PM +, Mark Morgan Lloyd wrote:> I think I've seen this question asked before, my apologies if this was> recently.> > I've got two programs intended to be functionally identical, one in Perl and> the other in FPC. They r

Re: [fpc-pascal] Unbuffering I/O

2018-08-29 Thread Henry Vermaak
On Wed, Aug 29, 2018 at 03:01:54PM +, Mark Morgan Lloyd wrote: > I think I've seen this question asked before, my apologies if this was > recently. > > I've got two programs intended to be functionally identical, one in Perl and > the other in FPC. They read a unix-domain datagram, decode the