--
local cp_func = os.type == "unix" and "cp" or "copy"
-- maybe it would be better to actually move the files
-- in reality it isn't.
-- local cp_func = os.type == "unix" and "mv" or "move"
function cp(src,dest)
local command = string.format('%s "%s" "%s"', cp_func, src, dest)
if cp_func == "copy" then command = command:gsub("/",'\\') end
log:info("Copy: "..command)
if not file_exists(src) then
local ksrc=kpse.find_file(src)
command = string.format('%s "%s" "%s"', cp_func, ksrc, dest)