{ "id": "109562", "key": "TIMOB-12742", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2013-02-12T18:26:48.000+0000", "priority": null, "labels": [ "android", "iOS" ], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:03:20.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "*Problem*\r\nBug description: Ti.Filesystem.Filestream.isWriteable() gives error in Android & iOS.\r\n\r\n*Steps to reproduce:*\r\n 1. copy and paste test code below into app.js\r\n 2. add attached file.txt to Resources folder\r\n 3. run code on device in android\r\n 4. click isReadable button, notice it works and returns boolean value true\r\n 5. click isWriteable button, notice error when it should return boolean value false\r\n 6. repeat steps on iOS simulator to see similar result \r\n\r\n*Expected Behavior*\r\nisWriteable should return false\r\n\r\n*Actual Behavior*\r\nisWritable throws error\r\n \r\n*Code example:* \r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : 'black'\r\n});\r\n\r\nvar button1 = Ti.UI.createButton({\r\n\ttop : 10,\r\n\ttitle : 'isReadable?'\r\n});\r\n\r\nvar button2 = Ti.UI.createButton({\r\n\ttop : 100,\r\n\ttitle : 'isWritable?'\r\n});\r\n\r\nbutton1.addEventListener('click', function(e) {\r\n\tvar infile = Titanium.Filesystem.getFile('file.txt');\r\n\tif (!infile.exists()) {\r\n\t\tTi.API.error(\"File not exists()\");\r\n\t\treturn;\r\n\t}\r\n\tvar instream = infile.open(Titanium.Filesystem.MODE_READ);\r\n\r\n\tvar isReadable = instream.isReadable();\r\n\r\n\talert('Is readable = ' + isReadable);\r\n});\r\n\r\nbutton2.addEventListener('click', function(e) {\r\n\tvar infile = Titanium.Filesystem.getFile('file.txt');\r\n\tif (!infile.exists()) {\r\n\t\tTi.API.error(\"File not exists()\");\r\n\t\treturn;\r\n\t}\r\n\tvar instream = infile.open(Titanium.Filesystem.MODE_READ);\r\n\r\n\tvar isWriteable = instream.isWriteable();\r\n\r\n\talert('Is writeable = ' + isWriteable);\r\n});\r\n\r\nwin.add(button1);\r\nwin.add(button2);\r\n\r\nwin.open();\r\n{code}", "attachment": [ { "id": "35580", "filename": "file.txt", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-14T22:15:22.000+0000", "size": 11, "mimeType": "text/plain" }, { "id": "35566", "filename": "FileStreamSample.zip", "author": { "name": "roman.kamenetsky", "key": "roman.kamenetsky", "displayName": "Roman Kamenetsky", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-14T11:52:02.000+0000", "size": 755338, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android/iOS: Ti.Filesystem.Filestream.isWriteable() doesn't work properly", "creator": { "name": "roman.kamenetsky", "key": "roman.kamenetsky", "displayName": "Roman Kamenetsky", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "CLI version 3.0.23, Titanium SDK version 3.0.2.v20130201161712", "comment": { "comments": [ { "id": "238432", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Roman,\n\nWould you mind providing a reproducible piece of test code that once could just paste into a project and run to produce the bug? This way I can reproduce exactly what you are trying and determine if it should be moved to engineering from there.\n\nThank you,\n\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-13T21:50:18.000+0000", "updated": "2013-02-13T21:50:18.000+0000" }, { "id": "238531", "author": { "name": "roman.kamenetsky", "key": "roman.kamenetsky", "displayName": "Roman Kamenetsky", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hello Carter,\r\n\r\nI attached the test project. Just run it.\r\n\r\nRegards, Roman", "updateAuthor": { "name": "roman.kamenetsky", "key": "roman.kamenetsky", "displayName": "Roman Kamenetsky", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-14T11:52:02.000+0000", "updated": "2013-02-14T11:52:02.000+0000" }, { "id": "238624", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Roman,\n\nI was able to recreate your bug so I will be moving this to Ti-Mobile and engineering will take a look at it. I have created my own test case though so that the error is more visible. Please keep a watch on the ticket and thank you for bringing this to our attention.\n\nBest,\n\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-02-14T22:07:52.000+0000", "updated": "2013-02-14T22:07:52.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }