Jump to content




Access denied


  • You cannot reply to this topic
6 replies to this topic

#1 MewMega

  • New Members
  • 6 posts

Posted 06 September 2012 - 05: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

#2 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 06 September 2012 - 05: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

#3 MewMega

  • New Members
  • 6 posts

Posted 06 September 2012 - 06:42 PM

Thanks for your help i fixed it

#4 kazagistar

  • Members
  • 365 posts

Posted 06 September 2012 - 06:45 PM

View Postsjele, on 06 September 2012 - 05:49 PM, said:

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:

Quote

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)


#5 sjele

  • Members
  • 334 posts
  • LocationSomewhere on the planet called earth

Posted 06 September 2012 - 06:47 PM

View Postkazagistar, on 06 September 2012 - 06:45 PM, said:

View Postsjele, on 06 September 2012 - 05:49 PM, said:

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
[CODE]
fs.delete("/startup")
fs.copy("/disk/startup", "/startup")

Ohh. Thanks.

#6 MewMega

  • New Members
  • 6 posts

Posted 07 September 2012 - 08:37 AM

Yep i found out
fs.copy("/disk/startup", "/startup")
and it worked. Thanks for your explanation

#7 Hayden_Almeida

  • Members
  • 49 posts

Posted 07 June 2015 - 12:35 AM

View PostMewMega, on 06 September 2012 - 05:45 PM, said:

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users