Directory:copytask(dirpath) method

Copies the Directory to a new one with the specified folder path, asynchronously (without blocking program execution flow)

Parameters

dirpath

A string representing the destination directory path.

Return value

Returns a Task that will return a boolean value indicating if the operation succeeded.

Example

local console = require "console" local dir = sys.Directory(C:\\test") -- copies the folder to another drive without blocking local task = dir:copy("D:\\test") console.write("Copying directory... ") while not task.terminated do console.write("■") sleep(1000) end