Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

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?

— asked April 30th 2010 by Trace Killough
  • filesystem
  • mobile
  • write
0 Comments

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.

    — answered May 17th 2010 by Trace Killough
    permalink
    0 Comments
  • I have the same question. I checked the API doc and it does not mention any methods for manipulating files.

    — answered May 1st 2010 by Iko Knyphausen
    permalink
    0 Comments
  • No one? Does anyone from Appcelerator monitor these questions? It would be really nice to put this one to rest.

    — answered May 14th 2010 by Trace Killough
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.