[TIMOB-2226] Filesystem file.rename() is not working on iOS
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:58:28.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M05 |
Components | iOS |
Labels | defect, filesystem, ios, ipad, iphone, release-1.6.0, rename |
Reporter | ctredway |
Assignee | Blain Hamon |
Created | 2011-04-15T03:14:07.000+0000 |
Updated | 2011-04-17T01:58:28.000+0000 |
Description
Using the following code, file.rename is not working.
var win = Ti.UI.currentWindow;
var f = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory, 'a.txt');
var newFile =
Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'newfile.txt');
newFile.write(f.read());
newFile.rename('b.txt');
var renamed =
Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'b.txt');
Ti.API.info(renamed.exists());
var file_tf = Titanium.UI.createTextField({
color:'#336699',
height:35,
top:0,
left:0,
width:320,
value:renamed.read()
});
win.add(file_tf);
This is tested against 4.1 and 1.5
This was assigned to Jonathan Sand for his exercise.
Assigning to Steve to manage the pull from Jonathan.
Fixed by commit/merge ff401e1e. Jonathan's solution was definitely more than satisfactory.
https://github.com/appcelerator/titanium_mobile/commit/ff401e1e4b16a35308b2cb72dd636dae6683c041"> https://github.com/appcelerator/titanium_mobile/commit/ff401e1e4b16...
[INFO] Titanium SDK version: 1.6.0 (01/13/11 08:11 7ca73a3). closed against KS fileSystem example. 4.2.1 ipod touch, 3.1.3 iphone 3g and wfif ipad running 3.2