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.
2 parents 92f99c3 + cadd98d commit 0fe95e9Copy full SHA for 0fe95e9
lib/dtutils/file.lua
@@ -291,9 +291,12 @@ 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
+ result = os.execute('copy "' .. fromFile .. '" "' .. toFile .. '"')
296
+ elseif dtutils_file.check_if_bin_exists("cp") then
297
result = os.execute("cp '" .. fromFile .. "' '" .. toFile .. "'")
298
end
299
+
300
-- if cp was not present, or if cp failed, then a pure lua solution
301
if not result then
302
local fileIn, err = io.open(fromFile, 'rb')
0 commit comments