Skip to content

Commit

Permalink
modify the ircdb.dat path referring to priv/
Browse files Browse the repository at this point in the history
  • Loading branch information
witeman committed Feb 9, 2012
1 parent f66c940 commit c2a3c9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/ircdb.erl
Expand Up @@ -33,7 +33,7 @@ convert(Dir) ->
Ets = ets:new(ircdb, [{keypos, 2}]),
read_hand_file(Ets, HandFile),
read_player_file(Ets, PlayerFile),
{ok, Dets} = dets:open_file(ircdb, [{file, "ircdb.dat"},
{ok, Dets} = dets:open_file(ircdb, [{file, "priv/ircdb.dat"},
{keypos, 2},
{ram_file, true}]),
ets:to_dets(Ets, Dets),
Expand Down
10 changes: 5 additions & 5 deletions src/mbu.erl
Expand Up @@ -35,7 +35,7 @@
-include("ircdb.hrl").

opendb() ->
{ok, Dets} = dets:open_file(ircdb, [{file, "ircdb.dat"},
{ok, Dets} = dets:open_file(ircdb, [{file, "priv/ircdb.dat"},
{keypos, 2}]),
Dets.

Expand Down Expand Up @@ -169,20 +169,20 @@ match_win_amounts([Amt1|Rest1], [Amt2|Rest2]) ->
end.

remove(GameId) ->
{ok, Dets} = dets:open_file(ircdb, [{file, "ircdb.dat"},
{ok, Dets} = dets:open_file(ircdb, [{file, "priv/ircdb.dat"},
{keypos, 2}]),
dets:delete(Dets, GameId),
dets:close(Dets).

print(GameId) ->
{ok, Dets} = dets:open_file(ircdb, [{file, "ircdb.dat"},
{ok, Dets} = dets:open_file(ircdb, [{file, "priv/ircdb.dat"},
{keypos, 2}]),
[Game] = dets:lookup(Dets, GameId),
io:format("~p~n", [Game]),
dets:close(Dets).

filter() ->
{ok, Dets} = dets:open_file(ircdb, [{file, "ircdb.dat"},
{ok, Dets} = dets:open_file(ircdb, [{file, "priv/ircdb.dat"},
{keypos, 2}]),
Props1 = dets:info(Dets),
Count1 = fetch_prop(size, Props1),
Expand All @@ -194,7 +194,7 @@ filter() ->
dets:close(Dets).

count() ->
{ok, Dets} = dets:open_file(ircdb, [{file, "ircdb.dat"},
{ok, Dets} = dets:open_file(ircdb, [{file, "priv/ircdb.dat"},
{keypos, 2}]),
Props = dets:info(Dets),
Count = fetch_prop(size, Props),
Expand Down

0 comments on commit c2a3c9a

Please sign in to comment.