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

Access Denied

Started by Hydrotronics, 20 December 2015 - 02:14 PM
Hydrotronics #1
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
KingofGamesYami #2
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.
Admicos #3
Posted 20 December 2015 - 03:37 PM
if fs.exisits("test") then
it should be exists
Edited on 20 December 2015 - 02:39 PM
Hydrotronics #4
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/>
KingofGamesYami #5
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.
Hydrotronics #6
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