Reputation: 22930
Since NSFileManager has no capabilities of returning the size of a directory, what would be a suitable & fast method for obtaining directory size?
Upvotes: 1
Views: 1038
Reputation: 67889
There is no fast method: you have to recursively request size of every file in the directory hierarchy.
Don't forget to handle special cases:
/dev
but can be created everywhere.Depending on your needs, you also have to choose between size of file contents or size of file on disk.
Upvotes: 4
Reputation: 2515
Enumerate all directories inside your folder. "Folder size will be = Sum of All file sizes in side that folder."
Some options:
There are other options too ... it depend on how you want to do.
Upvotes: 2