Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3386] Android: Write to File in Append Mode

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-05-02T21:47:14.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsparity
ReporterJon Alter
AssigneeIngo Muschenetz
Created2011-04-15T03:43:38.000+0000
Updated2017-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

Comments

  1. Lee Morris 2017-05-02

    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.

JSON Source