From: Bart Schaefer <schaefer@brasslantern.com>
To: Oliver Kiddle <okiddle@yahoo.co.uk>, zsh-workers@sunsite.dk
Subject: Re: printf again
Date: Fri, 9 Nov 2001 17:24:25 +0000 [thread overview]
Message-ID: <1011109172426.ZM15726@candle.brasslantern.com> (raw)
In-Reply-To: <3BEC04E4.91BE18D1@yahoo.co.uk>
On Nov 9, 4:31pm, Oliver Kiddle wrote:
}
} It is doing my head in to try to work out how to do the memory
} management for using sprintf so that print -f can work with -s/-z.
} Formats like `%#010000000x' don't make it easy.
Not surprising. You basically have to emulate the action of the printf
implementation. This is why some C libraries have snprintf() which will
return the length of the result without actually doing the print.
I suggest you punt: Just fprintf() to a temp file and then read it back.
If you wanted to get really fancy you could memory-map the file where
that is supported.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
next prev parent reply other threads:[~2001-11-09 17:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-09 16:31 Oliver Kiddle
2001-11-09 17:24 ` Bart Schaefer [this message]
2001-11-09 17:51 ` Oliver Kiddle
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1011109172426.ZM15726@candle.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=okiddle@yahoo.co.uk \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).