[TIMOB-3386] Android: Write to File in Append Mode
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Low |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2017-05-02T21:47:14.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | n/a |
| Components | Android |
| Labels | parity |
| Reporter | Jon Alter |
| Assignee | Ingo Muschenetz |
| Created | 2011-04-15T03:43:38.000+0000 |
| Updated | 2017-05-02T21:47:14.000+0000 |
Description
You cannot use MODE_APPEND to set the write mode to append when writing to a file, despite the properties listed in [Titanium.Filesystem](http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.Filesystem-module).
MODE_APPEND is not demonstrated anywhere in the KitchenSink - have raised ticket TIMOB-4212 to address.
In Android only, you can pass a boolean to write() to use append mode, as in the example below, but this is not documented.
var newFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'newfile.txt');
newFile.write('line 1\n');
newFile.write('line 2\n', true);
Ti.API.info('newfile: '+newFile.read());</code>
Ticket TIMOB-4213 has been raised to address this APIDoc issue.
Associated Helpdesk Ticket:
[http://developer.appcelerator.com/helpdesk/view/76562]
Remaining on this ticket:
* determine whether the write() boolean argument and/or MODE_APPEND should work on each platforms, and test to ensure that they are in parity
Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.