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:
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
/var/mobile/applications/*/
there. but, see you're shooting for. – nate mar 27 '13 @ 2:09