Yes, it’s odd.
If I take a folder containing two files (and no folders, and no hidden folders or files), foldercount(
correctly returns 2.
I create a blank folder there (to make 3 objects including 2 files) it still returns 2.
However, if I then I copy a file to that folder (to make 4 objects, 3 or which are files) it now returns 4.
I delete the folder, leaving just the original two files, but foldercount(
now returns 3, and if I delete those files it returns 1 for the empty folder.
Restoring the original two files, it again returns 3.
If I create a new empty folder within the original, and another nested within that and another nested within that, thus now a total of 5 objects including 2 files) it still returns 3.
However, if I now copy a file into the deepest folder (so there are now 6 objects, 3 of which are files) it now returns 6
If I delete the newest file to leave 5 objects (2 files and 3 empty, nested folders) it still returns 6.
If I delete the three nested folders to leave just the original 2 files, it once again returns 3.
While doing all this I had hidden files visible and there were none at any stage. But it seems that a folder containing a file (even if more deeply nested) is wrongly being counted as a file itself, and when files are deleted that error is corrected but the total ends up 1 more than it should be. Experimenting further after the above, repeatedly adding and deleting files and nested folders, I always end up with an error of 1 when I get back to the original folder contents.
I assume this must be an OS error, nothing to do with Panorama, but it‘s still bizarre.