使用任何标准的Robot库,是否可以将目录的内容递归复制到现有的目标目录?
基本上,我正在寻找以下shell命令的等效项:(cp -r foo/. bar
请注意结尾的点)
我试过了,Copy Directory
但这会在foo
内部创建一个目录bar
(如文档所述),即使提供尾随点,它也不会停止执行。Copy Files
遇到目录时会窒息。
有什么我忽略的吗?还是我只需要给cp -r
自己打电话?
由于我只需要在Linux上使用它,我最终实现了自定义关键字call cp -r
。如果跨平台需要这样做,那么我将按照建议在Python中直接实现它。
Copy Directory Contents
[Documentation] Recursively copies the contents of the source directory into the destination.
[Arguments] ${source} ${destination}
Directory Should Exist ${source}
Directory Should Exist ${destination}
${result} = Run Process cp -r ${source}/. ${destination}/
Should Be Equal As Integers ${result.rc} 0
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句