equal
deleted
inserted
replaced
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 |