{ "id": "86659", "key": "TIMOB-7707", "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": { "id": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-09T21:33:53.000+0000", "created": "2012-02-17T11:24:55.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "qe-ios021312" ], "versions": [ { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "issuelinks": [ { "id": "15262", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "76618", "key": "TIMOB-4469", "fields": { "summary": "Android: Filesystem exists() method used on file in resourcesDirectory always returns true even if the file is not present", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2020-01-09T21:33:53.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "description :Test presence of file that exists => false when it should be true\r\nsteps to reproduce :\r\n 1: Install and execute the following code\r\n\r\n{code}\r\nvar resourcesFileDoesExist = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'app.js');\r\nvar resourcesFileDoesNotExist = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'this-file-does-not-exist.js');\r\n\r\nvar newFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'this-file-exists.js');\r\nnewFile.write(\"testing a file\");\r\n\r\nvar appDataFileDoesExist = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'this-file-exists.js');\r\nvar appDataFileDoesNotExist = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'this-file-does-not-exist.js');\r\n\r\nvar label = Ti.UI.createLabel({\r\n color: '#FFF'\r\n});\r\nlabel.text = '*** Resources Dir: \\nTest presence of file that exists => ' +\r\n resourcesFileDoesExist.exists() +\r\n '\\nTest presence of file that does not exist => ' +\r\n resourcesFileDoesNotExist.exists() +\r\n '\\n\\n*** appData Dir: \\nTest presence of file that exists => ' +\r\n appDataFileDoesExist.exists() +\r\n '\\nTest presence of file that does not exist => ' +\r\n appDataFileDoesNotExist.exists();\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#000'\r\n});\r\nwin.add(label);\r\nwin.open();\r\n{code}\r\nexpected result : Test presence of file that exists => True \r\nActual result : Test presence of file that exists => false\r\nnote: this occurs is 1.8.1 as well", "attachment": [], "flagged": false, "summary": "IOS :file system-file exists under the resource directory, but exists method returns a false", "creator": { "name": "sshylaja", "key": "sshylaja", "displayName": "Sitara Shylaja", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sshylaja", "key": "sshylaja", "displayName": "Sitara Shylaja", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK version: 1.8.2.v20120216154635,1.8.1\r\nDevice Details:ipad2 4.3.5\r\nTitanium Studio version: 1.0.9.201202131024", "comment": { "comments": [ { "id": "185948", "author": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "In case there might be any doubt wether this is an actual issue: I have the exact same issue under 1.8.1 and 1.8.2. I didn't check any versions prior to 1.8.1.\r\n\r\nI spent a few hours fooling around with all other File properties (including the internal ones I noticed being used in the source-code @ Github), but unfortunately didn't get very far.. The File.exists-method seems to return the booleanized (!!) value for 'this._exists', which simply returned 'undefined' in all of my (iOS) test-cases, obviously resulting in 'false' being returned. After looking around for a bit it seems that '_exists' is only set when a file is written to, or is being created. The only other location where this variable is set (to true) is in the File's postscript-method. My guess would be that this method isn't being executed (correctly).\r\n\r\nFor the record: I only have these problems when running the app on my iPhone (iOs 5.0). Running the code in the iPhone Simulator seems to yield the correct results.\r\n\r\nTitanium Studio, build: 1.0.9.201202141208\r\nTitanium SDK: 1.8.1 & 1.8.2\r\niPhone 4 with iOs: 5.0 (9A334)", "updateAuthor": { "name": "ronaldtreur", "key": "ronaldtreur", "displayName": "Ronald Treur", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-03-12T07:21:12.000+0000", "updated": "2012-03-12T07:21:12.000+0000" }, { "id": "186262", "author": { "name": "timanrebel", "key": "timanrebel", "displayName": "Timan Rebel", "active": true, "timeZone": "Europe/London" }, "body": "After some testing with 1.8.2 and iOS 5.1 on an iPhone 4 (Not the simulator) it seems that this problem only occurs in the Resources directory and not in the Application Data directory.\r\n\r\n{noformat} \r\nvar dir = Titanium.Filesystem.getFile(Titanium.Filesystem.getResourcesDirectory(), 'app.js');\r\nTi.API.info('app.js exists: ' + dir.exists()); // Expected true, actual false\r\n\t\r\nvar dir = Titanium.Filesystem.getFile(Titanium.Filesystem.getResourcesDirectory(), 'testdir/Acl.js');\r\nTi.API.info('Acl.js exists: ' + dir.exists()); // Expected true, actual false\r\n\t\r\nvar dir = Titanium.Filesystem.getFile(Titanium.Filesystem.getApplicationDataDirectory());\r\nvar dirList = Titanium.Filesystem.getFile(dir.resolve()).getDirectoryListing();\r\n\t\r\nfor(var i = 0, length = dirList.length; i < length; i++) {\r\n Ti.API.info(i + ': ' + dirList[i] + ', exists: ' + \r\n Titanium.Filesystem.getFile(Titanium.Filesystem.getApplicationDataDirectory(), dirList[i]).exists()); // Expected true, actual true\r\n}\r\n{noformat} \r\n\r\n\r\nTitanium Studio, build: 2.0.0.201203121914\r\nTitanium SDK: 1.8.1 & 1.8.2\r\niPhone 4 with iOs: 5.1", "updateAuthor": { "name": "timanrebel", "key": "timanrebel", "displayName": "Timan Rebel", "active": true, "timeZone": "Europe/London" }, "created": "2012-03-13T12:12:02.000+0000", "updated": "2012-03-13T12:12:21.000+0000" }, { "id": "453597", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It has been decided that this issue should be closed as “Won’t do.” This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. \r\n\r\nIf community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T21:33:53.000+0000", "updated": "2020-01-09T21:33:53.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }