user/dev discussion of public-inbox itself
 help / color / mirror / Atom feed
From: Eric Wong <>
Subject: [PATCH] tmpfile: modernize to 5.10.1+, note O_APPEND workaround
Date: Fri, 16 Oct 2020 07:05:10 +0000
Message-ID: <> (raw)

Once again we'll need O_APPEND on a temporary file, so note we
support it, here; since Perl 5.32 is way too new to depend on
our users having.
 Just something I noticed while working on other stuff, since
 I'll be relying on O_APPEND tmpfile behavior in yet another place.

 lib/PublicInbox/ | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/ b/lib/PublicInbox/
index 25bb3a52..eb0fce00 100644
--- a/lib/PublicInbox/
+++ b/lib/PublicInbox/
@@ -2,8 +2,8 @@
 # License: AGPL-3.0+ <>
 package PublicInbox::Tmpfile;
 use strict;
-use warnings;
-use base qw(Exporter);
+use v5.10.1;
+use parent qw(Exporter);
 our @EXPORT = qw(tmpfile);
 use Fcntl qw(:DEFAULT);
 use Errno qw(EEXIST);
@@ -13,6 +13,9 @@ use File::Spec;
 # unlinked filename which makes sense when viewed with lsof
 # (at least on Linux)
 # And if we ever stop caring to have debuggable filenames, O_TMPFILE :)
+# This is also for Perl <5.32 which lacks: open(..., '+>>', undef)
+# <>
 sub tmpfile ($;$$) {
 	my ($id, $sock, $append) = @_;
 	if (defined $sock) {

                 reply	other threads:[~2020-10-16  7:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ \
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
 note: .onion URLs require Tor:

code repositories for the project(s) associated with this inbox:

AGPL code for this site: git clone