6 posts
Posted 06 September 2012 - 06:45 PM
I cant use fs.delete and fs.copy, access denied. But ive checked the permissions with fs.isReadOnly and it said false. Heres my Code:
fs.delete("/startup")
fs.copy("/disk/startup", "/")
The other Code is only text, its not needed. But if i run the program like this theres 'Access denied' … Help pls
318 posts
Location
Somewhere on the planet called earth
Posted 06 September 2012 - 06:49 PM
Startup is part of rom (i think) You can't edit startup nor delete it. The file is not realy there. Just make another file called startup and put code to startup from disk there
6 posts
Posted 06 September 2012 - 07:42 PM
Thanks for your help i fixed it
351 posts
Posted 06 September 2012 - 07:45 PM
Startup is part of rom (i think) You can't edit startup nor delete it. The file is not realy there. Just make another file called startup and put code to startup from disk there
This has nothing to do with anything. Startup is a normal file like any other, and as can be seen, is clearly not in rom, but in the root directory.
The problem is that in line 2, you are trying to copy startup over the root directory folder. Obviously, this is not allowed. What you want to do is
fs.delete("/startup")
fs.copy("/disk/startup", "/startup")
Here, check out the
documentation:
Copies a file or directory to a new location (the parent of the new location must be a directory, toPath must include the target filename and cannot be only a directory to move the file into, and toPath itself must not already exist)
318 posts
Location
Somewhere on the planet called earth
Posted 06 September 2012 - 07:47 PM
Startup is part of rom (i think) You can't edit startup nor delete it. The file is not realy there. Just make another file called startup and put code to startup from disk there
This has nothing to do with anything. Startup is a normal file like any other, and as can be seen, is clearly not in rom, but in the root directory.
The problem is that in line 2, you are trying to copy startup over the root directory folder. Obviously, this is not allowed. What you want to do is
fs.delete("/startup")
fs.copy("/disk/startup", "/startup")
Ohh. Thanks.
6 posts
Posted 07 September 2012 - 09:37 AM
Yep i found out
fs.copy("/disk/startup", "/startup")
and it worked. Thanks for your explanation
49 posts
Posted 07 June 2015 - 01:35 AM
I cant use fs.delete and fs.copy, access denied. But ive checked the permissions with fs.isReadOnly and it said false. Heres my Code:
fs.delete("/startup")
fs.copy("/disk/startup", "/")
The other Code is only text, its not needed. But if i run the program like this theres 'Access denied' … Help pls
I solved this problem!
ACESS DENIED occurs when before in your program or in usage of the computer, you are playing to changing or setting other directories..
Look at this example:
if fs.exists("/contas/"..conta.."/emails/"..assunto) then
When i use this, the WORKING directory is now inside the variable "assunto"!
So when you try to use
fs.delete("/contas/"..conta.."/emails/"..assunto)
It will try to go into more folders in who are already open!
How to Solve? Look:
shell.setDir("/contas/"..conta.."/emails/")
fs.delete("assunto")
Hope this works with you too :D/>