• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: in-memory files?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: I'll Bite
  • Next by Date: Re: I'll Bite
  • Previous by thread: Re: in-memory files?
  • Next by thread: Learning Cocoa: Dot View
  • Index(es):
    • Date
    • Thread