Skip to content
File systemReference

copyfile

Copy a file to another workspace path.

Details#

Copy a file to another workspace path. No return values.

Signature#

Luau
copyfile(source: string, destination: string): ()

Parameters#

ParameterTypeDescription
sourcestringExisting workspace-relative source path.
destinationstringWorkspace-relative target path.

Returns#

No return values.

Examples#

Local example

Luau
writefile("docs-example/original-copyfile.txt", "local note")
copyfile("docs-example/original-copyfile.txt", "docs-example/result-copyfile.txt")