How to locate it??

Discussion in 'iOS Programming' started by arnieterm, Oct 20, 2008.

  1. arnieterm macrumors regular

    Joined:
    Aug 28, 2008
    #1
    Hi
    I have to read URLs from SuspendState.plist for Safari on Iphone. Can anybody tell how to reach this file though on simulator it is located in IPhone Simulator/User/Library/Safari/SuspendState.plist.
    I have made use of the method "NSSearchPathForDirectoriesInDomains" but it is going ahead to the above location to the application.
    In short I have to locate the file "SuspendState.plist" on Iphone under Safari directory
    Can anybody help?
    Thanks
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    Assuming you are targeting non-jailbroken phones you can't: this breaches the application sandbox. You may only read or write your own applications files.
     
  3. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #3
    Using the method "directoryContentsAtPath" of NSFileManager class though I am be able to navigate to the location
    /private/var/mobile/Library/Safari without the jailbreak. If I beleive your suggestion that without the jailbreak we cannot read/write outside of our own application then how does this becomes possible?
    My only porblem is that I cannot move further beyond /Safari where probably I can find my SuspendState.plist file
    Any idea??
    Thanks
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    Are you doing this on the simulator or on a real device: the simulator does not act 100% the same as a real phone, in particular I don't think it enforces the sandboxing of apps as vigorously.

    As is made very clear in the iPhone Application Programming Guide (which you should have read) and application "is placed in its own directory and is limited to reading and writing files in that directory only".
     
  5. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #5
    It is not a simulator but an IPhone device, I have modified the Hellow World application to use the NSFileManager class, you can also try this and will get a directory structure
     
  6. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #6
    Just try it by giving value to path field as "/../" or "/var/" then you can move on
     
  7. arnieterm thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #7
    Can anybody tell me the location with complete path of SuspendState.plist [xml file containing list of open URLs along with respective timestamp for mobile safari] on an IPhone device.
    I also want to know whether there exists any particular setting on IPhone enabling/disabling it also results in creation/deletion of SuspendState.plist file.
    Thanks
     

Share This Page