|
From: | Christof Petig |
Subject: | Re: [Monotone-devel] Monotone ID shortener |
Date: | Mon, 03 May 2004 09:07:16 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux ppc; de-AT; rv:1.6) Gecko/20040414 Debian/1.6-5 |
Nathan Myers schrieb:
On Fri, Apr 30, 2004 at 05:40:22PM +0200, Christof Petig wrote:monoshort "monotone --db monotone.db" > short.sedPS: No, _I_ did _not_ design the semantics of underflow/uflow, I only struggled to implement them.Probably you would do better to extract the file descriptor from the FILE returned by popen, and then attach a buffering streambuf to it.
That's what I did in the 2.95 days. But I don't see any standard way to get a stream from the file number. Reading more closely i think you proposed to extract some internal data structure from FILE which (on Gnu libc systems) is used to construct a streambuf?
(It probably would be little more than two orders of magnitude faster.)
I don't see that that would be a lot faster since FILE* handles buffering for me. But perhaps a more sophisticated savailcount permits optimizations like reading more characters at once.
What you really want, most likely, is Jonathan Wakely's streambuf equivalent to popen that attaches streambufs instead of FILE*s. In the meantime, here are some fd streambufs and streams.
You are right. Why did I not find them the last time I looked for it :-( ?BTW: What is the license of the code you sent to me? May I add it to a GPL library?
Christof
[Prev in Thread] | Current Thread | [Next in Thread] |