[TIMOB-3873] iOS: file.open(Ti.Filesystem.MODE_WRITE) crashes simulator if file doesn't exist
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-05-11T18:36:42.000+0000 |
Affected Version/s | Release 1.7.0 |
Fix Version/s | Release 1.7.0, Sprint 2011-18 |
Components | iOS |
Labels | n/a |
Reporter | Bill Dawson |
Assignee | Jacob Relkin |
Created | 2011-05-02T17:02:59.000+0000 |
Updated | 2011-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.
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