changing permissions through code

Discussion in 'iOS Programming' started by raziiq, Aug 6, 2009.

  1. raziiq macrumors member

    Joined:
    Aug 26, 2008
    #1
    Is there anyway i can change the permissions of the iPhone system folders through code?
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    If you mean folders outside the sandbox, of course not. If you mean something inside the sandbox, you can but why would you want to?
     
  3. raziiq thread starter macrumors member

    Joined:
    Aug 26, 2008
    #3
    i mean folders outside the sandbox. I need to copy some files to it. May be to the /tmp folder.

    But the main question is how to change the permissions, what should be the syntax?
     
  4. jim93 macrumors newbie

    Joined:
    Jun 27, 2009
    #4
    I think you would be able to for Jailbroken iPhones but no way for regular iPhone. Are you trying to implement the iPhone virus discussed in the other thread
     
  5. raziiq thread starter macrumors member

    Joined:
    Aug 26, 2008
    #5
    Come on man, its not about virus or something. Ya i m developing for Jailbroken iPhone
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Then you probably need to go find some forums dealing with jailbroken phones then. That's not really discussed here. Sorry.
     
  7. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #7
    Well, it's the same code inside the sandbox or out.

    Look at the docs for NSFileManager. You need to set the NSFilePosixPermissions.

    Also

    man 2 chmod
     

Share This Page