[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding streams for standard out and standard err
From: |
Phillip Lord |
Subject: |
Re: Adding streams for standard out and standard err |
Date: |
Thu, 21 Jul 2016 20:01:19 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.95 (gnu/linux) |
Eli Zaretskii <address@hidden> writes:
>> Cc: address@hidden
>> From: Paul Eggert <address@hidden>
>> Date: Thu, 21 Jul 2016 16:40:10 +0200
>>
>> On 07/21/2016 04:21 PM, Eli Zaretskii wrote:
>> > . We already have (append-to-file START END FILENAME), which can be
>> > used to write a buffer or a string to a file. FILENAME can be
>> > "/dev/stderr" on Posix platforms, for example, or it can be a real
>> > file name.
>>
>> Wouldn't the proposed primitives often be more efficient than
>> append-to-file, since they would use stdio buffering?
>
> Probably. But is performance relevant to the use cases we intend them
> to be used?
You are correct in this case, performance is irrelevant. In fact,
buffering is a bit of a pain. It took me a few minutes to work out why
(print "hello" 'stdout)
worked but
(princ "hello" 'stdout)
didn't -- the latter gets buffered.
>> Presumably people using the new primitives would know about their
>> problems with tty and/or GUI frames, just as they know about the similar
>> problems that append-to-file has with /dev/stderr.
>
> I'm not so sure. But that's not the important part of my reasoning.
It's important to the "unreliable/dangerous" part of your argument.
I will add further documentation to the patch, pointing out this
potential problem.
Phil
Re: Adding streams for standard out and standard err, Phil Sainty, 2016/07/22