Comparison

util/datamanager.lua @ 2328:2804d81206d8

util.datamanager: Store data stores with no host in '_global' folder
author Matthew Wild <mwild1@gmail.com>
date Sun, 06 Dec 2009 00:35:06 +0000
parent 2159:2ef4458b23d9
child 2444:267d6482bac6
comparison
equal deleted inserted replaced
2325:265441f2ad48 2328:2804d81206d8
86 end 86 end
87 end 87 end
88 88
89 function getpath(username, host, datastore, ext, create) 89 function getpath(username, host, datastore, ext, create)
90 ext = ext or "dat"; 90 ext = ext or "dat";
91 host = host and encode(host); 91 host = (host and encode(host)) or "_global";
92 username = username and encode(username); 92 username = username and encode(username);
93 if username then 93 if username then
94 if create then mkdir(mkdir(mkdir(data_path).."/"..host).."/"..datastore); end 94 if create then mkdir(mkdir(mkdir(data_path).."/"..host).."/"..datastore); end
95 return format("%s/%s/%s/%s.%s", data_path, host, datastore, username, ext); 95 return format("%s/%s/%s/%s.%s", data_path, host, datastore, username, ext);
96 elseif host then 96 elseif host then