files in sandbox

Hi, a quick question.

My app allows the user to save and load files.

I want to distribute some example files in the systemDocumentsDirectory. Is there any way of doing this at setup or installation rather than once the app is running?

I know that many Apple apps for example come with exemplar files.

I know how to do it by writing files etc, but was looking for a way of having them as files in my app package and moving them across as part of install.

thanks in advance for any help.

Martin

I have discovered that files that are in the project folder are kept in the final application, now I just need to discover how to access them, I suspect it will be in tempDirectory. Any ideas?

Hi Martin,

Files that you bundle with the app will be in the main “resource” directory. However, you should be able to move them over to another directory from there. An example is contained near the end of this guide:

http://docs.coronalabs.com/guide/data/readWriteFiles/index.html

Hope this helps,

Brent

thanks Brent, I read that guide and used it to create new files but somehow skipped the reference to the resource directory. Now I’m cooking on gas.

Hi Brent, worked fine.

Good guide. I used the version which specifies nil as the sourcepath, which is said to work on Android too, I will test later, but IOS works fine.

I have discovered that files that are in the project folder are kept in the final application, now I just need to discover how to access them, I suspect it will be in tempDirectory. Any ideas?

Hi Martin,

Files that you bundle with the app will be in the main “resource” directory. However, you should be able to move them over to another directory from there. An example is contained near the end of this guide:

http://docs.coronalabs.com/guide/data/readWriteFiles/index.html

Hope this helps,

Brent

thanks Brent, I read that guide and used it to create new files but somehow skipped the reference to the resource directory. Now I’m cooking on gas.

Hi Brent, worked fine.

Good guide. I used the version which specifies nil as the sourcepath, which is said to work on Android too, I will test later, but IOS works fine.