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

Question- How to save Floppy disk content permanently on a computer

Started by Rampage9112, 26 March 2012 - 01:37 AM
Rampage9112 #1
Posted 26 March 2012 - 03:37 AM
I'm new to computercraft, but I managed to make a basic operating system.

After saving it to a floppy disk and putting it in another computer's disk drive, how do I save it so it is permanently on that computer, and replaces the startup program?

thanks for the help.
Casper7526 #2
Posted 26 March 2012 - 07:49 AM
cp disk/myprogram myprogram
BlackRa1n #3
Posted 26 March 2012 - 07:07 PM
If you wanted it to replace the startup file do…

cp disk/<Program> startup
Wolvan #4
Posted 26 March 2012 - 07:36 PM
or if you really want to mess around in the lua console use

fs.copy("disk/[Program_Name]", "startup")
ComputerCraftFan11 #5
Posted 26 March 2012 - 09:09 PM
To replace it, do:
fs.delete("startup")
fs.copy("disk/[name]", "startup")
Espen #6
Posted 26 March 2012 - 10:02 PM
@ComputerCraftFan11:
You don't actually need to delete the file before you copy it over, since copying it will overwrite it.
ComputerCraftFan11 #7
Posted 26 March 2012 - 10:05 PM
@ComputerCraftFan11:
You don't actually need to delete the file before you copy it over, since copying it will overwrite it.

ya, but if startup already exists in the computer, you will get a error saying lua:43: File exists
BlackRa1n #8
Posted 26 March 2012 - 10:15 PM
@ComputerCraftFan11:
You don't actually need to delete the file before you copy it over, since copying it will overwrite it.

ya, but if startup already exists in the computer, you will get a error saying lua:43: File exists

I was gonna say that, but I thought it might of just been my programming skills (What of them) and then I would of looked stupid! :o/>/>
Espen #9
Posted 27 March 2012 - 05:15 AM
@ComputerCraftFan11:
You don't actually need to delete the file before you copy it over, since copying it will overwrite it.

ya, but if startup already exists in the computer, you will get a error saying lua:43: File exists
Hmm, I was sure that wasn't the case with at least the older version then. Just went ahead and tested v1.21 but even that tells me "File existed".
I don't know why I thought that, I had that in my head like a bug that I don't personally find too serious but still is a bug.
Apparently though it doesn't exist!? Lol, I'm sorry, I really don't know what happened there in my brain, wrong memory.
Well I guess you learn best from errors right?^^ I shall refrain from making un-checked statements in the future, no matter how small the matter and how tedious the checking-procedure (like, setting up a backup copy of an old minecraft + an older version of CC just to check one little detail, lol).
Sorry again for the confusion, totally my bad. :o/>/>