Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3385] iOS: Write to File in Append Mode

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2011-05-24T13:39:31.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.7.0, Sprint 2011-20
ComponentsiOS
Labelsdefect, ios, reported-1.6.1, rplist
ReporterJon Alter
AssigneeJacob Relkin
Created2011-04-15T03:43:38.000+0000
Updated2011-05-24T13:39:31.000+0000

Description

You cannot use MODE_APPEND to set the write mode to append when writing to a file.
API docs say that Titanium.Filesystem.MODE_APPEND should be used.
No way to write in append mode on iOS

Tested With

iOS 4.3, TiSDK 1.6.1

Comments

  1. Jon Alter 2011-04-18

    This is how it works for Android
       var newFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'newfile.txt');
       newFile.write('line 1\n');
       newFile.write('line 2\n', true); // 'true' puts write() in append mode
       
       Ti.API.info('newfile: '+newFile.read());
       
  2. Jacob Relkin 2011-04-18

    This functionality will be merged with the Stream implementation in the near future. Regardless, I have resolved this issue and it is pushed to master. (commit 44467a48a979c1285310a18b4729458503b8fdbe)
  3. Natalie Huynh 2011-05-11

    Please attach test media when checked in
  4. Thomas Huelbert 2011-05-15

    As per Reggies last comment this issue is not fixed at this point.
  5. Natalie Huynh 2011-05-24

    Tested with 1.7.0.86dae2c... optionalArgAPIs true 10 Success readWriteText true 31 Success blobNativeFile true 49 Success dotSlash true 59 Success fileStreamBasicTest true 108 Success fileStreamWriteTest true 132 Success fileStreamAppendTest true 171 Success fileStreamPumpTest true 200 Success fileStreamWriteStreamTest true 220 Success fileStreamResourceFileTest true 220 Success fileStreamTruncateTest true 262 Success

JSON Source