Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
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
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
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
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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

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".
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
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
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
Just try it by giving value to path field as "/../" or "/var/" then you can move on
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.