We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb13518 commit d355095Copy full SHA for d355095
lib/dtutils/file.lua
@@ -291,9 +291,13 @@ dtutils_file.libdoc.functions["file_copy"] = {
291
function dtutils_file.file_copy(fromFile, toFile)
292
local result = nil
293
-- if cp exists, use it
294
- if dtutils_file.check_if_bin_exists("cp") then
+ if dt.configuration.running_os == "windows" then
295
+ os.execute('copy "' .. fromFile .. '" "' .. toFile .. '"')
296
+ result = true
297
+ elseif dtutils_file.check_if_bin_exists("cp") then
298
result = os.execute("cp '" .. fromFile .. "' '" .. toFile .. "'")
299
end
300
+
301
-- if cp was not present, or if cp failed, then a pure lua solution
302
if not result then
303
local fileIn, err = io.open(fromFile, 'rb')
0 commit comments