Add a general copy function for lua and use it with voicemail forward.

This commit is contained in:
Mark Crane
2013-07-11 19:50:09 +00:00
parent b895946be8
commit 80c1c9076c
3 changed files with 16 additions and 1 deletions
@@ -0,0 +1,14 @@
--add the copy function
function copy(src,dst)
if (package.config:sub(1,1) == "/") then
--unix
cmd = [[cp "]] .. src .. [[" "]] .. dst .. [["]];
elseif (package.config:sub(1,1) == [[\]]) then
--windows
src = src:gsub("/",[[\]]);
dst = dst:gsub("/",[[\]]);
cmd = [[copy "]] .. src .. [[" "]] ..dst.. [["]];
end
os.execute(cmd);
return cmd;
end