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

How would one edit a file?

Started by Agoldfish, 25 March 2014 - 07:32 PM
Agoldfish #1
Posted 25 March 2014 - 08:32 PM
The title pretty much explains it. How would one edit a file? I know how to open one, just not edit it. (Yes I looked on the Wiki.)
Edited on 25 March 2014 - 07:32 PM
CometWolf #2
Posted 25 March 2014 - 08:56 PM
I don't… what? How did you even make a program?
Agoldfish #3
Posted 25 March 2014 - 08:58 PM
I don't… what? How did you even make a program?
Well that was nice, reeeeeeeal encouraging there Comet. I guess I should have explained more. I mean edit a file from a program.
Cranium #4
Posted 25 March 2014 - 08:59 PM
Either type "edit <programname>" in the CraftOS prompt, or you can look in your Minecraft folder for the computercraft files which you can edit. The programs are in your save folder.
Agoldfish #5
Posted 25 March 2014 - 09:02 PM
Either type "edit <programname>" in the CraftOS prompt, or you can look in your Minecraft folder for the computercraft files which you can edit. The programs are in your save folder.
Look at the post above yours, I explained it more there.
CometWolf #6
Posted 25 March 2014 - 09:05 PM
http://computercraft.info/wiki/Fs_%28API%29
The FS API allows you to manipulate files and the filesystem.
You sure you looked?

tbh, i thought you would know this :P/>
Cranium #7
Posted 25 March 2014 - 09:05 PM
Well, not really. You didn't.
But the only other way you may be talking about is by using the fs API.
Take a look at the wiki, and tell us if you need help. Try to be as specific as possible, so you can get the proper help.
Agoldfish #8
Posted 25 March 2014 - 09:06 PM
http://computercraft...ki/Fs_%28API%29
The FS API allows you to manipulate files and the filesystem.
You sure you looked?

tbh, i thought you would know this :P/>
Well, I thought there was something like fs.write(), but maybe I was mistaken. Death already helped me in IRC as I'm posting this.
CometWolf #9
Posted 25 March 2014 - 09:08 PM
Indirectly there is yes, in the table returned by fs.open.
http://computercraft.info/wiki/Fs.open