develooper Front page | perl.perl5.porters | Postings from July 2019

[perl #134221] open(FH, "+>>", undef) doesn't set O_APPEND

Thread Next
Tony Cook via RT
July 2, 2019 05:46
[perl #134221] open(FH, "+>>", undef) doesn't set O_APPEND
Message ID:
On Sun, 23 Jun 2019 18:50:24 -0700, wrote:
> I love using open(FH, MODE, undef) to create unlinked temporary
> files with minimal typing.
> But I was surprised when using "+>>" as the MODE did not set
> O_APPEND on the temporary file handle (or warn about the ">>"
> being ignored.  I want to use O_APPEND so I can easily append to
> it from one callback while while using sendfile or pread+SSL_write
> to write to a socket.
> I'm using this as a lazy write buffer for reading the output of
>   process (e.g. git-http-backend/git-archive) while sending to
> a client which may not be able to keep up with the output speed.

I've attached a partial solution, that works on Linux (and presumably other POSIX-ish systems) and Win32.

From what I remember of a discussion with Craig back when working on the in-place editing re-work, the code currently guarded by !defined(VMS) should also work on VMS, except for the default to /tmp/.


via perlbug:  queue: perl5 status: new

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About