Warning
- This operation will block program flow execution.
- Use Directory.copytask() to copy directory asynchronously.
Directory:copy(dirname) method
Copies the Directory physically on the disk to the specified new directory name.
Parameters
dirname
A string representing the destination directory.
If the dirname contains a path, the path must already exist.
Return value
Returns aboolean
value indicating if the operation succeeded.
Example
local dir = sys.Directory(C:\\test")
-- copies the folder to another drive
print(dir:copy("D:\\test"))