Skip to content

Commit

Permalink
Implement open/2
Browse files Browse the repository at this point in the history
  • Loading branch information
krestenkrab committed Jan 15, 2012
1 parent 2f355a3 commit 33f62b2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/emmap.erl
@@ -1,6 +1,6 @@
-module(emmap).

-export([open/4, close/1, pread/3, pwrite/3, read/2, position/2]).
-export([open/2, open/4, close/1, pread/3, pwrite/3, read/2, position/2]).
-on_load(init/0).

-ifdef(TEST).
Expand Down Expand Up @@ -34,6 +34,14 @@ init() ->
erlang:load_nif(SoName, 0).


open(FileName, Options) ->
case file:read_file_info(FileName) of
{ok, FileInfo} ->
open(FileName, 0, FileInfo#file_info.size, Options);
Error ->
Error
end.

-spec open(File::string(),
Offset::pos_integer(),
Length::pos_integer(),
Expand Down

0 comments on commit 33f62b2

Please sign in to comment.