Re: Writing to memory instead of FILE

From: Claudio Puviani (puviani_at_hotmail.com)
Date: 04/29/04


Date: Thu, 29 Apr 2004 21:11:28 GMT


"Anders Thomsen" <junk@mexp.dk> wrote in message
news:5db7bcad.0404290556.70dad4a7@posting.google.com...
> (Using MS VC++ 6.0)
>
> In a lib file I have a method that takes a FILE as parameter. The
> method writes some text to this file. I don't need the text in a file
> but in a variable.
> So how can I make the method write to a buffer insted of a file on a
> disk?

With the caveat that this isn't portable (or standard), you could open both ends
of a pipe or a socket, associate one ebd with a FILE * that you pass to your
library, and populate the variable yourself by reading from the other end. As
convoluted as this is, it would still be much faster than file I/O and it
wouldn't require having write access to the disk.

Claudio Puviani



Relevant Pages

  • Re: Populating listview object with files
    ... > I need to populate a listview object with file names from a specied ... > folder on disk. ...
    (borland.public.delphi.language.objectpascal)
  • Re: Burn Folder
    ... more than the capacity of a single DVD-R disk. ... If I create a Burn Folder to ... To find out, create a Burn Folder, populate it, and then click on Burn. ...
    (comp.sys.mac.system)
  • Re: Dual Boot Question
    ... As the ebd was being made I got another error ... but it didn't make the boot disk. ... the disk on a machine running W2K Pro with the same result. ...
    (microsoft.public.windowsxp.help_and_support)
  • Populating listview object with files
    ... I need to populate a listview object with file names from a specied folder ... on disk. ...
    (borland.public.delphi.language.objectpascal)
  • Re: Blank CDs or CD-RW wont mount on a MAC G5
    ... Create a burn folder, and populate it. ... will be asked for the blank disk; insert the blank disk and it will ...
    (comp.sys.mac.system)