CocoaDev

Edit AllPages

Does anyone know of a method of getting the free disk space on a volume?

Cheers.


easiest way would be to use popen() or NSTask to run the df command. If that’s not acceptable, then you can snarf the df command from Darwin and see how they do it.


df works beautifully, thanks. :)


Interestingly… I found out Apple’s own installers use df - when I replaced df with a custom version and my machine wouldn’t update. ;)


Another method that seems to work just fine…