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
Post a Comment