fs.copy

From ComputerCraft Wiki
Revision as of 04:09, 12 March 2012 by Hawk777 (Talk | contribs) (Create page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Grid Redstone.png  Function fs.copy
Copies a file or directory to a new location (the parent of the new location must be a directory, toPath must include the target filename and cannot be only a directory to move the file into, and toPath itself must not already exist)
Syntax fs.copy(string fromPath, string toPath)
Returns nil
Part of ComputerCraft
API fs

Examples

Grid paper.png  Example
Makes a copy of a file "test1" in the root directory, calling it "test2" and storing the copy in a directory called "mydir"
Code
fs.copy("test1", "mydir/test2")