Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: printf again
- X-seq: zsh-workers 16229
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Oliver Kiddle <okiddle@xxxxxxxxxxx>, zsh-workers@xxxxxxxxxx
- Subject: Re: printf again
- Date: Fri, 9 Nov 2001 17:24:25 +0000
- In-reply-to: <3BEC04E4.91BE18D1@xxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <3BEC04E4.91BE18D1@xxxxxxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author