From c2a3c9a86be8e6def1c4744bdfd96265769e5a16 Mon Sep 17 00:00:00 2001 From: Witeman Zheng Date: Thu, 9 Feb 2012 14:49:13 +0800 Subject: [PATCH] modify the ircdb.dat path referring to priv/ --- src/ircdb.erl | 2 +- src/mbu.erl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ircdb.erl b/src/ircdb.erl index c37354e..93d2b7b 100644 --- a/src/ircdb.erl +++ b/src/ircdb.erl @@ -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), diff --git a/src/mbu.erl b/src/mbu.erl index 343c89b..545e7d9 100644 --- a/src/mbu.erl +++ b/src/mbu.erl @@ -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. @@ -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), @@ -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),