Search code examples
iphoneobjective-cjailbreak

Write to iPhone file system - Jailbreak/Toolchain


so I am working on a jb app that requires writing to the file system (/var/mobile/Library/Downloads specifically), and I tried hard coding it in like someone recommended but I cant seem to make it work, i know how to do so to the Documents directory in my app but not the file system, any ideas? thank you!

edit 1 - as reference: the way that the Safari DL Plugin does it


Solution

  • try this path /private/var/mobile/Library/Downloads

    You need to check if the directory already exists or not before writing to it. You can use NSFileManager class for file/directory operations. You also need to check for the permissions on that folder, your app if not running as root cannot write to folders which only root has access to.