Odd result "sometime" with CalculateDirectorySizeMBS on macOS 12.3 M1

Hi @Christian_Schmitz ,

I’m working with the CalculateDirectorySizeMBS FolderItem function and getting odd values on an M1 under macOS 12.3. The function works properly on Windows and Linux. Here’s my code:

Dim FolderSize As DirectorySizeMBS
FolderSize = f.CalculateDirectorySizeMBS
EstArchiveSize = FolderSize.PhysicalTotalSize   // LogicalTotalSize
lSourceSize.Text = kSourceSize_text + SizeFromBytes(Format(EstArchiveSize, "#"))

Here’s a screenshot of the debugger versus Finder’s Get Info:

Any thoughts on what could be occurring? MBS Release 22.1, Xojo 21r3.1.

My guess would be a bug in Monterey 12.3, I’blve had to find workarounds for two so far this last week or so.

:frowning:

Monterey is making me use my PC and Linux more and more …

1 Like

is that a special folder?
Maybe we can’t look inside a lot of folders?

I lost a folder (from an HDD) that was moving into another external (SSD) after the HDD (source) was disconected (fall into the ground).

The HDD (3GB WD I think) contents have to be copied elsewhere (a partition have troubles to be mounted…).

It’s just a normal folder that contains 3 other folders. No special ACL’s, EAs, or BSDFlags assigned.

Also, similar failure on other, generic folders. I end up with 4K, 8K, or 12K in each case.

To work around this, I’m using a Shell and dd for macOS:

tmpShell.Execute "du -s """ + obj.FolderItem.NativePath + """ | cut -f 1"

And displaying a pacifier dialog while dd works.