[erlang-questions] Can epp_dodge:parse accept a ram_file?

Bengt Kleberg <>
Tue Feb 11 07:08:28 CET 2014


Greetings,

The documentation for file:open/2 says that the ram option will give "an
fd() which lets the file module operate on the data in-memory as if it
is a file."
We are not assured that epp_dodger:parse/3 will accept it. Your test
seems to show that it does not.

Have you tried the fd() from ram with the io module, too?


bengt

On Tue, 2014-02-11 at 13:19 +0800, Leo Liu wrote:
> In
> 
>   {ok, IoDevice} = file:open(Text, [ram]),
>   epp_dodger:parse(IoDevice, 1, [{no_fail, true}])
> 
> where Text is a string, I am always getting:
> 
> exception error: no function clause matching 
>         io:request({file_descriptor,ram_file,#Port<0.13034>},
>                    {get_until,unicode,[],erl_scan,tokens,[1,[]]}) (io.erl, line 553)
> 
> Ideas?
> 
> Thanks,
> Leo
> 
> Erlang/OTP 17 [RELEASE CANDIDATE 1] [erts-6.0] [source-0cbf6ec7]
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions




More information about the erlang-questions mailing list