173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
Posted 20 December 2015 - 03:14 PM
Well, this is quite a basic thing.
I'm trying to make a temporary file but whenever I try to delete it, it gives me Access Denied
Why is this?
Code:
if fs.exisits("test") then
fs.delete("test") -- Where it says Access Denied
file = fs.open("test","w")
file.writeLine('shell.run("CTest")')
file.close()
else
file = fs.open("test","w")
file.writeLine('shell.run("CTest")')
file.close()
end
3057 posts
Location
United States of America
Posted 20 December 2015 - 03:36 PM
Are you using an OS or anything that might modify the fs API on your computer? If not, my best guess is it's a non-CC issue with file permissions on your IRL computer.
275 posts
Location
Turkey
Posted 20 December 2015 - 03:37 PM
if fs.exisits("test") then
it should be exists
Edited on 20 December 2015 - 02:39 PM
173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
Posted 20 December 2015 - 03:39 PM
no API changes, and my computer file perms were set so computercraft could do stuff
if fs.exisits("test") then
it should be exists
yes i know, i hand typed it in and i wasn't paying much attention. in the actual code it is like that :P/>
3057 posts
Location
United States of America
Posted 20 December 2015 - 03:41 PM
The only other thing I can think of is the file being open already. If you open a file and do not close the handle, no program will be able to use that file until the computer is rebooted.
173 posts
Location
The hall of 1000 monkeys and only 1 typewriter
Posted 20 December 2015 - 03:43 PM
The only other thing I can think of is the file being open already. If you open a file and do not close the handle, no program will be able to use that file until the computer is rebooted.
yeah thx! that actually was the case XD. I rebooted and it sorted itself out :)/>
Edited on 20 December 2015 - 02:44 PM