Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25602] Windows: Titanium.Filesystem ( Folder exists in real physical path but it always shows as false).

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-01-22T03:35:07.000+0000
Affected Version/sRelease 7.0.0
Fix Version/sn/a
ComponentsWindows
Labelsn/a
Reporteralka.gurung
AssigneeKota Iguchi
Created2017-12-11T21:31:01.000+0000
Updated2019-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

FileDateSize
test.js2017-12-11T21:29:19.000+0000834

Comments

  1. Kota Iguchi 2018-01-17

    https://github.com/appcelerator/titanium_mobile_windows/pull/1172
  2. Kota Iguchi 2018-01-22

    Merged.

JSON Source