[TIMOB-25602] Windows: Titanium.Filesystem ( Folder exists in real physical path but it always shows as false).
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-01-22T03:35:07.000+0000 |
Affected Version/s | Release 7.0.0 |
Fix Version/s | n/a |
Components | Windows |
Labels | n/a |
Reporter | alka.gurung |
Assignee | Kota Iguchi |
Created | 2017-12-11T21:31:01.000+0000 |
Updated | 2019-05-09T06:48:00.000+0000 |
Description
Steps to generate this problem:
Issue 1:
Folder exists in real physical path but it always shows as false.
var cDir;
if(Ti.Filesystem.isExternalStoragePresent())
{
cDir = Ti.Filesystem.externalStorageDirectory + "/Attachments";
}
else
{
cDir = Ti.Filesystem.applicationDataDirectory + "/Attachments";
}
var folder = Titanium.Filesystem.getFile(cDir);
if(!folder.exists()) //folder doesn't exists
{
folder.createDirectory(); //create folder. OK
}
//after creating folder, try to check if folder exists statement anywhere in code.
//it always shows as false even if folder is present.
Ti.API.info("folder exists:" + folder.exists());
Issue 2:
Creating subfolder always makes application crash. Code:
var cDirTemp;
cDirTemp = cDir + "/Temp";
var folderTemp = Titanium.Filesystem.getFile(cDirTemp);
if(!folderTemp.exists())
{
folderTemp.createDirectory(); //this line makes application crash.
}
else{
folderTemp.deleteDirectory(true);
folderTemp.createDirectory();
}
Testing code is attached for detail.
Attachments
File | Date | Size |
test.js | 2017-12-11T21:29:19.000+0000 | 834 |
https://github.com/appcelerator/titanium_mobile_windows/pull/1172
Merged.