Re: in-memory files?
Re: in-memory files?
- Subject: Re: in-memory files?
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 20 Aug 2001 08:07:29 -0700
On Monday, August 20, 2001, at 07:52 AM, R. Tony Goold wrote:
Thanks, but that's still not it. The situation is that there is code
I want to re-use that wants to write to an open file descriptor,
(using fwrite(), fprintf(), etc.) and I want to capture that output in
memory, rather than letting it get out to the filesystem.
Well, I'm just about stumped... the only memory-related function I can
think of that returns a file descriptor is shm_open(). If you don't
mind using shared memory for your task, then that ought to solve the
problem.
Perfect! That's exactly what I need. Thanks.
So, I'll use shm_open(), hand the file descriptor to the legacy code to
fill it in, and then read it into an NSData object.
-jcr
(Still wondering what happened to NeXSTEP's memory streams.)
"The right to be heard does not include the right to be taken
seriously." - Hubert Humphrey