return true
end
---- check if a file is available locally
--- @param c a cache table
--- @param server the server name
--- @param location location relative to the server url
--- @return bool
--- @return an error object on failure
-function cache.file_local(c, server, location)
- local rc, re = file_in_cache(c, server, location)
- if re then
- return false, re
- end
- if rc then
- return true
- end
- local ce, re = cache.ce_by_server(c, server)
- if not ce then
- return false, re
- end
- if ce.islocal == false then
- return false
- end
- local path, re = cache.file_path(c, server, location)
- if re then
- return false, re
- end
- if not path then
- return false
- end
- if not e2lib.isfile(path) then
- return false
- end
- return true
-end
-
--- fetch a file from a server, with caching in place
-- @param c a cache table
-- @param server the server name