file size of application incl. resource fork folder


I have made an application launcher which is supposed to show the actual size like in finder. Is there an easy way find out the total
size of an application incl. the ressource fork folder? A shell/terminal command would also work.

you can try our DirectorySizeMBS class:

Would a modern OSX app even HAVE resource forks? AFAIK they shouldn’t.

I think he means the entire bundle size

I use this extend for getting the Size of a Folder.

Function fFolderLength(Extends f As FolderItem) As UInt64
  #If TargetMacOS Or TargetLinux
    // Get out if this isn't a Folder or not there
    If Not f.Directory Or Not f.Exists Then Return 0
    // Command
    Dim cmd As String
    cmd = "find"
    // Command Args
    Dim args() As String
    args = Array(f.ShellPath, "-type f -print0 | xargs -0 stat -f %z | awk '{sum += $1} END {print sum}'")
    Dim s As New Shell
    s.Execute(cmd, join(args, " "))
    Dim i64Result As UInt64
    i64Result = CLong(s.result)
    Return i64Result
  #ElseIf TargetWin32
    Return 0
End Function

I have customers who keep font suitcases from the pre-OS X era. Such fonts contain a resource fork, which is still supported by OS X. There was also Quicktime movies with Resource forks, and probably more.

So for a general use application launcher, you might have people still using such files.

Yep. I meant the bundle size.

I will try your suggestion.


You code seems to work but in rare cases the bublde size isn’t correct. Not sure why but it should be an issue.

what size do you need?
Our class calculates the logical size (byte sum) and the physical size on disk (block sizes summed)