FolderItem - Is there a fast way to find the number of sub folders?

Is there a fast way to find the number of sub folders? I tried f.parent.count and that gave me the FILES in the folder but not the sub folders. Do I have to iterate through each to find out if they are folders or files?

Or is there a better/faster way?

Thanks,
Tim

In pure Xojo you would need to iterate through them all recursively.

If you’re on macOS or linux you could use a shell to run find which is extremely fast.

find /my/folder/path -type d | wc -l

If you use MBS Xojo Plugins, you can use the DirectorySizeMBS class.

2 Likes