Re: Consulting a memfile

Paulo Moura <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hi Carlo,

On 09/10/2013, at 23:39, Carlo Capelli <[email protected]> wrote:

> Hi Paulo
> 
> I think it's already supported, see the last option of load_files/2, but I don't know if you can consult such memfile.
> A silly test
> 
> test2 :-
>    atom_to_memory_file('t:-writeln(1).', H),
>    open_memory_file(H, read, S, [free_on_close(true)]),
>    load_files(a_name, [stream(S)]),
>    close(S),
>    t. 

I wasn't aware of the stream/1 option of load_file/2. Thanks for pointing it out and for the sample code.

Cheers,

Paulo


> 2013/10/10 Paulo Moura <[email protected]>
> Hi,
> 
> I'm looking into the "memfile" library and wondering (1) how easy it would be to add support for consulting them like we do with an ordinary file and (2) how fast creating/writing to a memory file and then consulting it would be compared to create, write to, and consult an ordinary temporary file. Your feedback is most appreciated.
> 
> Cheers,
> 
> Paulo

-----------------------------------------------------------------
Paulo Moura
Logtalk developer

Email: <mailto:[email protected]>
Web:   <http://logtalk.org/>
-----------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.