util/datamanager.lua
changeset 13184 48622b89f570
parent 13141 b417a49cc31b
child 13185 87487056bccb
equal deleted inserted replaced
13183:1b1ed555f307 13184:48622b89f570
   395 		return floor(t.file:seek("end") / index_item_size) - 1;
   395 		return floor(t.file:seek("end") / index_item_size) - 1;
   396 	end;
   396 	end;
   397 }
   397 }
   398 
   398 
   399 local function get_list_index(username, host, datastore)
   399 local function get_list_index(username, host, datastore)
   400 	log("debug", "Loading index for (%s%s/%s)", username, host, datastore);
   400 	log("debug", "Loading index for (%s@%s/%s)", username, host, datastore);
   401 	local index_filename = getpath(username, host, datastore, "lidx");
   401 	local index_filename = getpath(username, host, datastore, "lidx");
   402 	local ih = io_open(index_filename);
   402 	local ih = io_open(index_filename);
   403 	if ih then
   403 	if ih then
   404 		local magic = ih:read(#index_magic);
   404 		local magic = ih:read(#index_magic);
   405 		if magic ~= index_magic then
   405 		if magic ~= index_magic then