<p>I am using the following code to determine free space on a volume.
The folder was provided using NSOpenPanel.  The item selected was a mounted volume and the path returned is \Volumes\Name</p>

<pre><code>NSDictionary* fileAttributes = [[NSFileManager defaultManager] fileSystemAttributesAtPath:folder];

unsigned long long size = [[fileAttributes objectForKey:NSFileSystemFreeSize] longLongValue];    
</code></pre>

<p>Is there a better method to determine the free space on a mounted volume using Cocoa?</p>

<p>Update: This is in fact the best way to determine the free space on a volume.  It appeared it wasn't working but that was due to the fact that folder was actually /Volumes rather  than /Volume/VolumeName</p>

statfs is consistent with results from df. In theory NSFileSystemFreeSize comes from statfs, so your problem should not exist.
You may want to run statfs as below as a replacement for NSFileSystemFreeSize:
```
```
#include <sys/param.h>
#include <sys/mount.h>

int main()
{
    struct statfs buf;

    int retval = statfs("/Volumes/KINGSTON", &buf);

    printf("KINGSTON Retval: %d, fundamental file system block size %ld, total data blocks %d, total in 512 blocks: %ld\n",
            retval, buf.f_bsize, buf.f_blocks, (buf.f_bsize / 512) * buf.f_blocks); 
    printf("Free 512 blocks: %ld\n",  (buf.f_bsize / 512) * buf.f_bfree); 
    exit(0);
}
```
```