Re: Writing to memory instead of FILE
From: Claudio Puviani (puviani_at_hotmail.com)
Date: 04/29/04
- Next message: John Torjo: "[ann] Easy LogView"
- Previous message: Claudio Puviani: "Re: Cracking DES with C++ is faster than Java?"
- In reply to: Anders Thomsen: "Writing to memory instead of FILE"
- Next in thread: Walter Tross: "Re: Writing to memory instead of FILE"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: John Torjo: "[ann] Easy LogView"
- Previous message: Claudio Puviani: "Re: Cracking DES with C++ is faster than Java?"
- In reply to: Anders Thomsen: "Writing to memory instead of FILE"
- Next in thread: Walter Tross: "Re: Writing to memory instead of FILE"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|