SimpleTee flush
I find the TestLib.pm framework to be more friendly with the
attached tweak to SimpleTee.pm. It's not a big deal, so if anyone
objects I'll let it drop, and I don't think it merits anything
fancier.
Objections?
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Attachments:
SimpleTee-flush.diffinvalid/octet-streamDownload
diff --git a/src/test/perl/SimpleTee.pm b/src/test/perl/SimpleTee.pm
index 8d31a40..5da82d0 100644
--- a/src/test/perl/SimpleTee.pm
+++ b/src/test/perl/SimpleTee.pm
@@ -20,6 +20,7 @@ sub PRINT {
my $ok = 1;
for my $fh (@$self) {
print $fh @_ or $ok = 0;
+ $fh->flush or $ok = 0;
}
return $ok;
}
Kevin Grittner <kgrittn@ymail.com> writes:
I find the TestLib.pm framework to be more friendly with the
attached tweak to SimpleTee.pm. It's not a big deal, so if anyone
objects I'll let it drop, and I don't think it merits anything
fancier.
Just out of curiosity --- what's the rationale for flushing after
every line, rather than once at the end of the loop? Is there
actual input-reading going on underneath the @$self notation?
If it's just dumping data from process memory, I should think
one flush would be sufficient.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote:
Just out of curiosity --- what's the rationale for flushing after
every line, rather than once at the end of the loop? Is there
actual input-reading going on underneath the @$self notation?
If it's just dumping data from process memory, I should think
one flush would be sufficient.
Isn't the loop over file handles written to? What would you flush
outside the loop?
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Kevin Grittner <kgrittn@ymail.com> writes:
Tom Lane <tgl@sss.pgh.pa.us> wrote:
Just out of curiosity --- what's the rationale for flushing after
every line, rather than once at the end of the loop?
Isn't the loop over file handles written to?
Oh... I just automatically read it as looping over some data,
not printing the same data to multiple filehandles. That's kind of
odd ... but yeah, you would have to do it like that.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Kevin Grittner <kgrittn@ymail.com> wrote:
I find the TestLib.pm framework to be more friendly with the
attached tweak to SimpleTee.pm.
Pushed.
Please ignore the typo in the commit message -- I was looking right
at the code saying "autoflush", but what came off my fingers (from
muscle memory?) was "autocommit". :-/
--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers