I’m most particularly wanting to be able to run file:consult("myfile.gz", [compressed])
. At the moment, the options as I see it for dealing with a compressed file are:
- read the file in and write it back out as uncompressed
- shell out to
os:cmd("gunzip myfile.gz")
- reimplement
consult/1
and the unexportedconsult_stream/1
I suspect having the option of passing read_ahead
would also be desirable. I’m not sure which other modes would be particularly useful, but it seems reasonable to me accept [mode()]
as an optional Opts
parameter.
-spec consult(Filename, Opts) -> {ok, Terms} | {error, Reason} when
Filename :: name_all(),
Opts :: [mode()],
Terms :: [term()],
Reason :: posix() | badarg | terminated | system_limit
| {Line :: integer(), Mod :: module(), Term :: term()}.