so, I have
filename = nil
write"filename: "
input = read()
filename = input
h = fs.open("Mydir/filename")
filename being the variable, i have been at this for 3 hours now, and cannot figure it out.
Any help would be appreciated
Thanks,
Andrew
local path = "/whatever/your/path/is/"
local filename = "myfile.txt"
file = fs.open(path .. filename, mode) -- where mode is "r", "w" etc.
write"Filename: "
filename = read()
h = fs.open("Mydir/"..filename) -- dont have quotes around your variable
How do you do the , "w" thing to write to the file?Well to shorten up all of your extra variables, you could simply dowrite"Filename: " filename = read() h = fs.open("Mydir/"..filename) -- dont have quotes around your variable
How do you do the , "w" thing to write to the file?Well to shorten up all of your extra variables, you could simply dowrite"Filename: " filename = read() h = fs.open("Mydir/"..filename) -- dont have quotes around your variable
fs.open(path, mode)
Wiki: http://computercraft.info/wiki/index.php?title=Fs.open
write"Filename: "
filename = read()
h = fs.open("Mydir/"..filename, "w")
h.write("rofl")
h.close()