This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Agenerick's profile picture

[Question] How to use "copy" in program

Started by Agenerick, 01 January 2013 - 05:50 AM
Agenerick #1
Posted 01 January 2013 - 06:50 AM
I was writing an install program and i want to use "copy" command but how to use it in program?
As i saw that redpulse is and command but rs.setOutput is like redpulse but like command.
GopherAtl #2
Posted 01 January 2013 - 08:24 AM
you could do shell.run(), but the fs api has a copy() function


fs.copy(sourcePath,newPath)
nqeron #3
Posted 01 January 2013 - 08:25 AM
As usual, the wiki is a great resource. I would suggest looking at the help on the Fs commands. In specific, you can use Fs.copy() to perform this action.
Agenerick #4
Posted 01 January 2013 - 10:46 AM
you could do shell.run(), but the fs api has a copy() function


fs.copy(sourcePath,newPath)

When I write and run that, It says : (my program name) :(line): attempt to perform aritchmetic __div on table and nil
I'm new to Lua so can someone help me?
GopherAtl #5
Posted 01 January 2013 - 10:47 AM
paths are strings. put ""s around them.