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

Need to code to copy a file from disk.

Started by SNWLeader, 10 October 2012 - 01:53 AM
SNWLeader #1
Posted 10 October 2012 - 03:53 AM
I wanted to know how could I copy a file from a disk to the computer so this way all I have to do is put the disk in the diskdrive and the file would copy into the computer.

i am trying to get it so I can have bosschat on a disk the disk would copy it to the computer.

I just need it to copy the file. thanks
Luanub #2
Posted 10 October 2012 - 03:54 AM
You'll want to use the fs API. Here is the syntax for the file copy. You can add an if statement or whatever you need to it.


fs.copy("disk/programName", "filePath/programName")
SNWLeader #3
Posted 10 October 2012 - 03:55 AM
o.k thank you. now lets see if this will work.
Fatal_Exception #4
Posted 10 October 2012 - 03:56 AM
The FS API contains functions for working with files.
SNWLeader #5
Posted 11 October 2012 - 01:58 AM
I cannot get this to work…..I need to figure out how to get the paths correct. I am trying to get the file from the disk to the computer and it keeps telling me no such file. Can you give me an example or something.
Lyqyd #6
Posted 11 October 2012 - 02:06 AM
He posted an example above.