I was wondering whether it is possible to retrieve saveImage() and io.write() data after losing them through the dropbox sync crash. The text and image data I have lost is VERY important for some work I am doing at the moment.
The step by step method of reproducing this bug : First create an image and string, then use saveImage() and io.write() to save the image and string. Then turn off internet connection, then dropbox sync. The app will crash at this point. Then turn on the internet connection, then dropbox sync again. The syncing will appear to work but after checking dropbox, there are no files there.
Now I have been doing a bit of research and it seems the files might still be there on the ipad somewhere but after looking through iexplorer, I cannot find them. Is there a way to retrieve them now?
Would it be a good idea to save the data locally to the ipad documents as a secondary backup (even if it is difficult to retrieve it later)?
@simeon@dave1707 hi guys, do you have any idea how I can retrieve those lost files? There might be a place where they get saved before syncing that I cannot see?
I’m sure you’ve already done this, but check your remote dropbox. What file extensions do the files have? (the asset picker only shows certain extensions, eg .txt for text files)
@yojimbo2000 Hello Yep ive checked all dropboxes, ive used iexplorer to look inside all the ipads files.
I was hoping someone could point me to the hidden directories where all data go before it gets synced, or where all the old data is located, or some way to force a resync to dropbox. The files cant be deleted just after it syncs to dropbox, can it?
@yojimbo2000@simeon I have looked through all codea directories and have concluded that the pre-sync files are not stored in there. So it must be elsewhere on the ipad temp files. Is this correct?
Ah after some more investigation, the pre-sync files are stored in the drop.assetpacks folder. This can be found on the ipad using a directory like ifunbox, but cannot be seen on the typical dropbox app until syncing is done. So i assume these files will be deleted once syncing happens, that means that the old files are most likely irretrievable.
Cool! Any chance you could add extensions for text-based 3D file formats? .obj .mtl
Part of the issue seems to be that readText and saveText (like readImage and saveImage) truncate the extension. Also that file extensions other than txt don’t show up in the asset picker.
@Simeon - while we’re talking file formats (and not wishing to distract from the question above), is there any chance of offering a built in OBJ file read function in a future version? @yojimbo2000 already has code for this, which might just need some testing for robustness (which we can do for you).
@yojimbo2000 - perhaps we can run a few models through your code to make sure it is robust enough for general use. I’ll do some testing if you link me to your code.
@Simeon my apologies, the extensions you listed above do show in the asset picker ( @archistudent so you could use files with .json extensions with ReadText and saveText, I misinformed you).
Regarding other text-based 3D file formats, there’s directX (extension .x) and collada (.dae) and Stanford (.ply).
Thanks everybody, I will use saveText in my next build!
Just some clarification for myself, what is the best local save and read method for apps that is intended for appstore? obviously this method cannot rely on codea or dropbox anymore, thus the methods ive used here is not viable. The method ideally will allow you to keep data cached on the local ipad, and in the event the app crashes, the data can be retrieved by the app once it is restarted again. I am sure lots of other apps like news apps use this local storage for their articles.