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

Help with CD and Disk Drives?

Started by Whoaaaaa, 04 March 2012 - 11:40 AM
Whoaaaaa #1
Posted 04 March 2012 - 12:40 PM
I want to learn how to put everything from a PC onto a disk drive, And then move it to another PC, I know it's possible. I've seen it done. Also, How do I install it on the other computer? Help would be appreciated :unsure:/>/>

- Whoaaaaa
kelechi96 #2
Posted 04 March 2012 - 12:58 PM
What do you mean ? You could return the values into a list and make a program to automatically copy them, you could copy them one by one … elaborate on exactly what you want the program to do.
Whoaaaaa #3
Posted 04 March 2012 - 01:05 PM
I want to get a program Example :
startup
print ("Example")
Say I would want that example on another computer, By putting it onto a Disk Drive, How could I install the program onto the program onto the Disk Drive?
And how can I install the program onto another computer from that Disk Drive
kelechi96 #4
Posted 04 March 2012 - 01:12 PM
What you need to do is just auto-copy the files, which isn't too difficult, just fs.copy(Source, Destination)

E.g

fs.copy("/disk/startup", "/startup")

If you had this as a file on this disk and ran it it would copy the disks' startup file to the computers startup.

However if you want to copy ALL the files on a computer automatically you'll need more code (I'll get back to you on that in a sec.
Whoaaaaa #5
Posted 04 March 2012 - 01:15 PM
Yeah but, How can I put the file on the disk. x_x
Liraal #6
Posted 04 March 2012 - 01:17 PM
the reverse. swap the parameters…
Whoaaaaa #7
Posted 04 March 2012 - 01:20 PM
Don't understand what you're trying to say Liraal.
Liraal #8
Posted 04 March 2012 - 01:21 PM
fs.copy("/startup", "/disk/startup")
Clear now?
Whoaaaaa #9
Posted 04 March 2012 - 01:27 PM
Now, when I put it into a disk drive of another computer, When I startup it has random numbers. :unsure:/>/>
kelechi96 #10
Posted 04 March 2012 - 02:51 PM
This'll point you in the right direction http://computercraft.info/wiki/index.php?title=Fs.list.
The return value from fs.list combined with fs.copy should let you copy all the files on a computer … I would suggest NOT copying the ROM folder due to the fact you can't write to it (hense Read Only Memory)