objective c - How to get Size and free space of a directory in cocoa? -


i want access actual size of directory, , free space available in directory. used [nsfilemanager defaultmanager]attributesofitematpath:path error:&error] method. method works fine files directory, not provide actual value. please solve problem. in advance.

you can calculate size of directory using particular method, fastest, using carbon, instead of nsenumerator : here

to calculate free space, use method. make sure enter full path of volume :

nsdictionary* fileattributes = [[nsfilemanager defaultmanager] filesystemattributesatpath:folder];

unsigned long long size = [[fileattributes objectforkey:nsfilesystemfreesize] longlongvalue];

where size you're looking for.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -