I am trying to get the size of a directory, as well as it's content on OS X using Swift. So far, I have only been able to get the size of the directory itself, with none of it's content. For most of my directories it generally shows a value of 6,148 bytes but it does varie.
I have tried the directorySize() function from the file below but it returned 6,148 bytes as well.
I tried the top 2 answers from this question, but was unsure what argument it needed passed Swift to the Objective-C function. I believe it wants a pointer (I am a beginning programmer in learning).
Calculate the size of a folder
And I could not get the Swift answer from here to work for my purpose either.
How to get the file size given a path?
I am using Xcode 7.0 and running OS X 10.10.5.