Skip to content

Commit

Permalink
Added initial memory mapped file support.
Browse files Browse the repository at this point in the history
  • Loading branch information
oubiwann committed Aug 16, 2023
1 parent f703e36 commit 99c2834
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
]}.
Expand Down
12 changes: 12 additions & 0 deletions src/lxml-mmap.lfe
Original file line number Diff line number Diff line change
@@ -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)))

0 comments on commit 99c2834

Please sign in to comment.