View Issue Details

IDProjectCategoryView StatusLast Update
0019092MMW 5Extensions frameworkpublic2022-09-30 19:18
Reporterzvezdan Assigned To 
PriorityhighSeverityminorReproducibilityN/A
Status closedResolutionreopened 
Fixed in Version5.0.4 
Summary0019092: app.filesystem.getFolderFromString('C:').hasSubfolders is false, but that drive has subfolders
DescriptionHow is it supposed to determine if some folder has subfolders? It was quite simple with the Windows FileSystemObject:
Set oFileObj = CreateObject("Scripting.FileSystemObject")
oFileObj.GetFolder(sFolder).SubFolders.Count
TagsNo tags attached.
Fixed in build2650

Activities

Ludek

2022-05-27 17:07

developer   ~0068302

In 5.0.4.2650 added new method updateHasSubfoldersAsync that updates hasSubfolders value based on current file system state .

i.e can be used like this:
var fld = app.filesystem.getFolderFromString('C:');
var hasSubfolders = await fld.updateHasSubfoldersAsync();
// hasSubfolders == fld.hasSubfolders here

zvezdan

2022-05-27 17:15

updater   ~0068304

Thanks. Maybe I was too fast when asking for this. Shouldn't (fld.getFolderList().whenLoaded().count != 0) be used instead?

Ludek

2022-06-20 10:39

developer   ~0068606

Sure, it can be, but updateHasSubfoldersAsync() is faster than getFolderList().whenLoaded().count != 0

peke

2022-09-30 19:18

developer   ~0069589

Verified 2667

Tested using example from 0019092:0068302