[TIMOB-19128] Windows: Ti.Filesystem.File.createDirectory will fail if parent directory does not exist
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-07-02T19:28:58.000+0000 |
Affected Version/s | Release 4.1.0 |
Fix Version/s | Release 4.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Christopher Williams |
Created | 2015-07-01T10:10:06.000+0000 |
Updated | 2015-07-07T21:19:45.000+0000 |
Description
The following code works fine on iOS and Android but will crash the app on Windows, *without showing anything in the logs*:
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title: 'Click'
});
btn.addEventListener('click', function (e) {
var dir1 = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'dir1');
dir1.createDirectory();
console.info('Working fine');
var dir2 = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'sub', 'dir2');
dir2.createDirectory();
console.info('Will have crashed on Windows');
});
win.add(btn);
win.open();
https://github.com/appcelerator/titanium_mobile_windows/pull/347
Verified the fix. Closing. Environment: Appc Studio: 4.1.0.201507071122 Ti SDK: 4.1.0.v20150706111546 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0-1 APPC CLI: 4.1.0-6 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1