filesystem on mobile platform
I'm trying to create a text file on the iPhone emulator. The documentation does refer to a file in KitchenSink called filesystem.js. While it's helpful at getting info about anything that already exists, it gives no info about creating new files or writing to those that already exist. An answer to the following thread says it's possible.
(http://developer.appcelerator.com/question/3661/few-questions-re-database-file-system-encryption)
I can manually create a file, pull out its contents but it shows as read only, so there's no appending it. Can anyone shed some light on this?
3 Answers
-
Accepted Answer
OK, I've found something that works.
var rowdata = 'some content for the file'; var filename = 'data.csv'; var myFile = Titanium.Filesystem.getFile(Titanium.Filesystem.tempDirectory, filename); myFile.write(rowdata);
I can then retrieve this file and email it. I hope this helps someone else.
-
I have the same question. I checked the API doc and it does not mention any methods for manipulating files.
-
No one? Does anyone from Appcelerator monitor these questions? It would be really nice to put this one to rest.