Created
March 19, 2011 01:04
-
-
Save jonalter/877108 to your computer and use it in GitHub Desktop.
Filesystem MODE_APPEND
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'text.txt'); | |
Ti.API.info('file = ' + f); | |
var contents = f.read(); | |
Ti.API.info('exists = ' + f.exists()); | |
Ti.API.info("contents blob object = "+contents); | |
Ti.API.info('contents = ' + contents.text); | |
var newFile = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,'newfile.txt'); | |
Ti.API.info('mode: '+ Ti.Filesystem.MODE_APPEND); | |
newFile.write(f.read()); | |
newFile.write('line 5555'); | |
Ti.API.info('newfile: '+newFile.read()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment