简体   繁体   中英

Sandboxed Application: Retrieve a folders size in MB/GB

I would like to find the size of a given path in MB/GB. I have tried before with NSFileManager but every result would turn out zero because of the app sandboxing (frustrating). Is there a method which works? I want to find the size of a hidden folder.

Thanks in advance.

Is it a path where you don't have access to by default, like user's home folder? Then you need to request access to it from the user by showing her standard open dialog (NSPanel). If you want to retain this access between launches, you need to generate and store security-scoped bookmark to that location.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM