How can I access a text file on iPhone directly?

I use io to store configuration data.

I.e. local filepath = system.pathForFile( “somefile.txt”, system.DocumentsDirectory )

While I’m messing around the format of the file changes and in the simulator I change the file manually to reflect the new format.
When I test on the device I need to be able to do that too.

Of course I can write an app to simply delete the file as I create it if not found but every once in a while direct access would sure be nice.

TIA - Heinz [import]uid: 6547 topic_id: 1104 reply_id: 301104[/import]

Can you explain more about what you’re trying to do? If you’re trying to access a textfile in your application’s directory on the device from OUTSIDE that application, that’s basically impossible in iPhoneOS, since applications and their data are very highly sandboxed.

On Android, you could probably get to it with an ordinary file browser, although I haven’t tested this myself. [import]uid: 3007 topic_id: 1104 reply_id: 2812[/import]

Yes, it’s the iPhoneOS sandbox I want to get in to :slight_smile:

I thought I might be out of luck but wanted to be sure I didn’t miss anything.

Guess I’ll change filenames until I settle on the final format.
When an App is updated to the device, does it play in the same sandbox as the previous version or is a new sandbox created each update?
[import]uid: 6547 topic_id: 1104 reply_id: 2818[/import]

When you update an app on the device, in theory it should replace the previous app and its sandbox data.

In practice, I’ve read that it’s best to manually delete the previous app on the phone, which will also wipe out associated data. I don’t know how much of a problem this actually is, but I personally delete the old app every single time just to be sure I’m always testing with fresh data. [import]uid: 3007 topic_id: 1104 reply_id: 2819[/import]

I assume that there is a way to keep settings? Must be as I never have to redo settings in apps I bought.

How is that done via Corona (for the iPhone/iPad)? [import]uid: 6547 topic_id: 1104 reply_id: 2821[/import]

Did some trial and error testing.

When “replacing” an App the sandbox seems to stay intact. Since the configuration file is not part of the update package it seems to stay intact.

If you first delete the App and then install it, a new sandbox is created and the App starts with a fresh configuration.

That’s pretty well how the purchased apps behave so I guess that answers my question :slight_smile: [import]uid: 6547 topic_id: 1104 reply_id: 2822[/import]