Connecting Tech Pros Worldwide Help | Site Map

FILE out of memory

Gerrit Hulleman
Guest
 
Posts: n/a
#1: Jul 22 '05
Is there a way to assign memory to a FILE variable, allowing information to
be read from memory in stead of from drive?

I am trying to re-use an open-source package. This package uses a FILE*
variable to load information from a file. Te content of the file is present
in memory, and would like like the integrated package to use this stream in
stead of a file.

Situation:
Info = "<XML><Test/></XML>";
FILE *input =fopen('input.xml','r');

Writing the Info to a file and than point to that file would be possible,
but is there a way to point the input var to the info? I cannot change the
FILE type of the var, since it is deeply integrated in the package.

Gerrit Hulleman


Karl Heinz Buchegger
Guest
 
Posts: n/a
#2: Jul 22 '05

re: FILE out of memory


Gerrit Hulleman wrote:[color=blue]
>
> Is there a way to assign memory to a FILE variable, allowing information to
> be read from memory in stead of from drive?
>
> I am trying to re-use an open-source package. This package uses a FILE*
> variable to load information from a file. Te content of the file is present
> in memory, and would like like the integrated package to use this stream in
> stead of a file.
>
> Situation:
> Info = "<XML><Test/></XML>";
> FILE *input =fopen('input.xml','r');
>
> Writing the Info to a file and than point to that file would be possible,
> but is there a way to point the input var to the info? I cannot change the
> FILE type of the var, since it is deeply integrated in the package.
>[/color]

No.
Not with FILE

If the package had used the C++ streams, there would be a way. But not
with the old C FILE functionality.

--
Karl Heinz Buchegger
kbuchegg@gascad.at
Closed Thread