Posted 20 November 2012 - 01:34 PM
The fs api is quite useful for things like keeping track of variables inside files, but if the file it's trying to open doesn't exist, it just returns nil. I think you should either have it create that file, or you could add:
Thanks for taking your time to read,
[indent=5]Shnup :(/>/>[/indent]
Also read my Advanced Printers suggestion!
fs.make(filename)
It would be useful for things like this:
if fs.exists("file") then
file = fs.open("file","r")
contents = file.readAll()
file.close()
print(contents)
else
fs.make("file")
file = fs.open("file","w")
contents = "BlahBlah"
file.write(contents)
file.close()
print(contents)
end
and I know I would use it a LOT!Thanks for taking your time to read,
[indent=5]Shnup :(/>/>[/indent]
Also read my Advanced Printers suggestion!