ios - Unable to create Directory outside the sandbox for THEOS Tweak -


i'm making iphone tweak using theos hooks google chrome app. part of tweak functions, handle downloading , saving files using asihttprequest/asinetworkqueue. user can choose , set download destination freely. works fine long set download path "/tmp" or google chrome documents folder. when try choose folder other these, instance "/var/mobile/documents/" no permission error:

domain=nscocoaerrordomain code=513 "the operation couldn’t completed. (cocoa error 513.)" userinfo=0x1f53e230 {nsfilepath=/var/mobile/documents, nsunderlyingerror=0x1f53b3d0 "the operation couldn’t completed. operation not permitted

i've looked error , tried every other answer suggested here on stackexchange no avail.

i'm developing ios 6 , i'm including answers i've read here links in case guys think missed out something:

1 - how make directory ios?

2 - iphone create folder outside sandbox

3 - cydia app documents folder not created

4 - gaining root permissions on ios nsfilemanager (jailbreak)

the last link refers running app root access non mobile directories not sure if appropriate since i'm making tweak chrome.

i hope me issue or point me in right direction. i'm tearing hair out.

here's common code snippet creating directory doesn't work me:

nsstring* savedir = @"/var/mobile/documents/test"; nsfilemanager* filemanager = [nsfilemanager defaultmanager];  nsmutabledictionary* attributes = [[nsmutabledictionary alloc] init]; nsnumber* permission = [nsnumber numberwithlong: 0755]; [attributes setobject:permission forkey: nsfileposixpermissions]; nserror* error = nil; if (![filemanager createdirectoryatpath: savedir              withintermediatedirectories: yes                                     attributes: attributes                                    error: &error])  {     nslog(@"unable create data directory: %@", error); } [attributes release]; 

thank guys in advance

share|improve question
    
is there reason need write outside sandbox? can not use chrome's normal sandbox needs? – nate mar 26 '13 @ 21:58
    
as mentioned tweak has feature allows user choose destination folder download anywhere within /var/mobile directory. instance he/she might want set destination /var/mobile/documents or /var/mobile/library/somedirectory. example of safari download manager uses if see mean. – boudarbalat mar 26 '13 @ 22:37
    
yeah, read part. question why? why need give user ability? understand why user might want define whole hierarchy of relative folders put downloads in. why absolute path important? why can't downloads go somewhere within sandbox area? i'm trying understand why problem worth tearing hair out over. point let user put files in locations meaningful app? – nate mar 26 '13 @ 22:42
    
well 1 reason myself have various applications use downloading stuff , have them download same location easy , quick access. other reason think hard standard user navigate chrome sandbox unless example has ifile installed , enables option show applications names instead of app's install path – boudarbalat mar 26 '13 @ 22:57
    
fair enough. i'll that it's not hard standard user navigate chrome sandbox. if present file picker dialog, can open programmatically @ chrome documents or caches root. wouldn't have navigate through /var/mobile/applications/*/ there. but, see you're shooting for. – nate mar 27 '13 @ 2:09
up vote 2 down vote accepted

my note cocoanuts sandcastle bigboss right. i've linked sandcastle dylib , using methods able create files/directories outside sandbox.

another library h2co3 unbox, allows same thing difference within unbox commands executed daemon.

share|improve answer

your answer

 
discard

posting answer, agree privacy policy , terms of service.

not answer you're looking for? browse other questions tagged or ask own question.

Comments