There seems to be no way to remove a file in the document directory (for example), since the path is hidden, and |D| does not appear to work for os.remove() to specify the document directory.
@Dale, if you are using my BhSnapshot plugin (as you hinted earlier) there is a helper method defined in there called pathForFile() that will return a full path for a given file name (including ones that contain |D|).
Note the the bug fix ("Bug: os.remove and os.rename doesn't transform path names"). I haven't tried this version yet but it may do what you want directly.
Excellent, thanks @atlim (and @bowerandy for the useful utility function)!
On a slightly related, and less critical note:
I sometimes find it handy to test and distribute (for beta versions) my app via Cydia. This fails for me, with Gideros.
It turns out that Cydia doesn't put the app in /var/mobile/Applications/[uid]/AppName like the app store does, so it appears |D|,|R| (at least) fail to find a useful path.
(As a workaround, if opening my database in the document dir fails, I then create a /var/mobile/Library/AppName/ directory, and open the file there instead. That seems to work.)
I'm not sure if this is something that Gideros really needs to address or not. I thought I'd mention it here in case others came across problems when using Cydia.
@Dale interesting way to distribute betas via Cydia. Have not tried that yet, but we are using testflight to distribute betas, and Gideros works flawlessly.
Comments
You can call it like:
/var/mobile/Applications/9901F6E8-A761-421D-A55F-F36E0BDF3EC1/Documents/gideros/BhItemSlider/documents/MyDocFile.txt
Alternatively add the following method to a plugin of your choice:
http://www.giderosmobile.com/DevCenter/index.php/Release_notes
Note the the bug fix ("Bug: os.remove and os.rename doesn't transform path names"). I haven't tried this version yet but it may do what you want directly.
Best regards
On a slightly related, and less critical note:
I sometimes find it handy to test and distribute (for beta versions) my app via Cydia. This fails for me, with Gideros.
It turns out that Cydia doesn't put the app in /var/mobile/Applications/[uid]/AppName like the app store does, so it appears |D|,|R| (at least) fail to find a useful path.
(As a workaround, if opening my database in the document dir fails, I then create a /var/mobile/Library/AppName/ directory, and open the file there instead. That seems to work.)
I'm not sure if this is something that Gideros really needs to address or not. I thought I'd mention it here in case others came across problems when using Cydia.
Thanks,
-d
http://www.nightspade.com