【发布时间】:2015-09-13 12:03:36
【问题描述】:
在 Windows 上,我在 C:\Users\test\Documents 中有一个名为“test.txt”的文件,我想用路径(来自属性)\10.2.2.22\my_folder\ 将它复制到我的网络文件夹中输出
我用这一行正确地在 Windows 上创建了文件:
File.open("#{Dir.pwd}/output.txt",'a') do |file|
file.puts "Hello!"
end
然后,我尝试复制它
sent_to_folder=exec('copy output.txt \\10.2.2.22\my_folder\output')
但我收到错误“系统找不到指定的路径”。 如果我通过 cmd 运行相同的命令,则文件被正确复制
有什么建议吗?
【问题讨论】: