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

I Need Help For A Profile Maker Plzz

Started by Saxguy99, 26 August 2013 - 04:27 PM
Saxguy99 #1
Posted 26 August 2013 - 06:27 PM
Hi i im trying to make a operating system that allows multiple people to make different profiles on it. The only problem is that i don't know how to save the users data so its there for ever in the program until they delete there profile or change it for example they change there password. So if anyone can help that would be great and when i make a youtube video on the os… when its done ill give shout out who helped. So basically i just need some thing that will sava user inputs until its deleted or changed. BYE
Kingdaro #2
Posted 26 August 2013 - 07:11 PM
So, what have you got so far?
Saxguy99 #3
Posted 26 August 2013 - 07:29 PM
nothing this well be my starting point in the project
Shaun #4
Posted 26 August 2013 - 07:37 PM
Have a look at the fs api, specifically fs.open.
fileHandle = fs.open("somefile", "w") --open the file somefile in write mode (file is erased)
fileHandle.write("some stuff")
fileHandle.close()

fileHandle = fs.open("somefile", "r") --open the file somefile in read mode
myString = fileHandle.readAll()
fileHandle.close()

Always remember to close your file after you're done reading from/writing to it.
theoriginalbit #5
Posted 26 August 2013 - 07:37 PM
This is a very common thing that is asked for. As such I've wrote up an explanation countless times, don't have the time or will to do it now, so I'll just link you to one of them….

http://www.computercraft.info/forums2/index.php?/topic/13504-making-multiple-users-on-one-computer/

Make sure you read the entire thread.
Saxguy99 #6
Posted 26 August 2013 - 08:15 PM
ok thanks
Saxguy99 #7
Posted 26 August 2013 - 09:03 PM
let me look an ill get back