So i'm working on a super simple logs library to make outputting errors/messages to a log alot simpler in a different program i'm working on. The issue is that i am completely unable to find a way to create a new file inside of code!
I remember in computercraft it was simply trying to open a file that didn't exist yet, would create a new one. but for some reason, it's not doing it in this instance.
my code is roughly:
local fname ="output.txt"local file, err = io.open(fs.concat(shell.getWorkingDirectory(),"/logs/",fname),w)--i've tried both w and a
at this point i'm really not sure what i'm doing wrong! is there a specific function to create a new file? make directory only lets you create folders from what my experiences/documentation has said.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
So i'm working on a super simple logs library to make outputting errors/messages to a log alot simpler in a different program i'm working on. The issue is that i am completely unable to find a way to create a new file inside of code!
I remember in computercraft it was simply trying to open a file that didn't exist yet, would create a new one. but for some reason, it's not doing it in this instance.
my code is roughly:
at this point i'm really not sure what i'm doing wrong! is there a specific function to create a new file? make directory only lets you create folders from what my experiences/documentation has said.
Link to post
Share on other sites