Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3873] iOS: file.open(Ti.Filesystem.MODE_WRITE) crashes simulator if file doesn't exist

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2011-05-11T18:36:42.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sRelease 1.7.0, Sprint 2011-18
ComponentsiOS
Labelsn/a
ReporterBill Dawson
AssigneeJacob Relkin
Created2011-05-02T17:02:59.000+0000
Updated2011-05-11T18:36:42.000+0000

Description

If a file doesn't yet exist, it should still be able to be open()'d writable. This fails:
var f = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'not_exist.xx');
var stream = f.open(Ti.Filesystem.MODE_WRITE); // crash
Problem is "handle = \[NSFileHandle fileHandleForUpdatingAtPath:filePath\];" which requires the file to exist.

Comments

  1. Natalie Huynh 2011-05-11

    Tested with 1.7.0.879871b...(05/10/11 19:34) 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