Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you find how much disk space is left in Cocoa?

I suppose I'd like to be able to find out for any storage, not just the system disk, but that's most important.

like image 896
zekel Avatar asked Oct 26 '09 17:10

zekel


1 Answers

Hard disk device manufacturers, use:

1GB = 1000MB

1MB = 1000 KB etc.

If you see a 8GB USB stick in Windows always shows less space than real (like 7,8 GB) because it is considered 1 GB = 1024 MB). In OSX the same USB stick is 8GB (real).

so (freeSpace / 1073741824) must be (freeSpace / 1000000000)

at least in OSX

like image 53
Mike97 Avatar answered Nov 21 '22 09:11

Mike97