diff --git a/rebar.config b/rebar.config index 97a8918..8e2041c 100644 --- a/rebar.config +++ b/rebar.config @@ -4,6 +4,7 @@ {deps, [ {lfe, "2.1.2"}, {lutil, "0.14.3"}, + {emmap, "2.0.11"}, {erlsom, "1.5.1"}, {fast_xml, "1.1.49"} ]}. diff --git a/src/lxml-mmap.lfe b/src/lxml-mmap.lfe new file mode 100644 index 0000000..614c93b --- /dev/null +++ b/src/lxml-mmap.lfe @@ -0,0 +1,12 @@ +(defmodule lxml-mmap + (export + (read 1) (read 2))) + +(defun read (filename) + (read filename '(read shared direct))) + +(defun read (filename opts) + (case (emmap:open (lutil-file:expand-home-dir filename) + opts) + (`#(ok ,mem ,info) `#m(mem ,mem info ,info)) + (err err)))