{ "id": "62858", "key": "TIMOB-2226", "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": [ { "id": "11238", "name": "Release 1.6.0 M05", "archived": true, "released": true, "releaseDate": "2011-01-17" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:58:28.000+0000", "created": "2011-04-15T03:14:07.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "defect", "filesystem", "ios", "ipad", "iphone", "release-1.6.0", "rename" ], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:58:28.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": "{html}
Using the following code, file.rename is not working.
\nvar win = Ti.UI.currentWindow;
\nvar f =\nTitanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,\n'a.txt');
\nvar newFile =\nTitanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'newfile.txt');
\nnewFile.write(f.read());
newFile.rename('b.txt');
\nvar renamed =\nTitanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'b.txt');
\nTi.API.info(renamed.exists());
var file_tf = Titanium.UI.createTextField({
\ncolor:'#336699',\nheight:35,\ntop:0,\nleft:0,\nwidth:320,\nvalue:renamed.read()
\n
\n});
\nwin.add(file_tf);
\nThis is tested against 4.1 and 1.5
This was assigned to Jonathan Sand for his exercise.
\nAssigning to Steve to manage the pull from Jonathan.
Fixed by commit/merge ff401e1e. Jonathan's solution was\ndefinitely more than satisfactory.
\n\nhttps://github.com/appcelerator/titanium_mobile/commit/ff401e1e4b16...
[INFO] Titanium SDK version: 1.6.0 (01/13/11\n08:11 7ca73a3). closed against KS fileSystem example. 4.2.1 ipod\ntouch, 3.1.3 iphone 3g and wfif ipad running 3.2