diff --git a/lib/dtutils/file.lua b/lib/dtutils/file.lua index 69243e9..f4306ff 100644 --- a/lib/dtutils/file.lua +++ b/lib/dtutils/file.lua @@ -291,9 +291,12 @@ dtutils_file.libdoc.functions["file_copy"] = { function dtutils_file.file_copy(fromFile, toFile) local result = nil -- if cp exists, use it - if dtutils_file.check_if_bin_exists("cp") then + if dt.configuration.running_os == "windows" then + result = os.execute('copy "' .. fromFile .. '" "' .. toFile .. '"') + elseif dtutils_file.check_if_bin_exists("cp") then result = os.execute("cp '" .. fromFile .. "' '" .. toFile .. "'") end + -- if cp was not present, or if cp failed, then a pure lua solution if not result then local fileIn, err = io.open(fromFile, 'rb')