I am very confused on the output of disk_free_space vs. df
Some examples:
For a drive that is local:
php -r "print disk_free_space('/Users');"
124647247872
df /Users/
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
/dev/disk1 974716928 730754360 243450568 76% 91408293 30431321 75% /
243450568 * 512
(output of df) = 124646690816
which is reasonably similar to the output of php which is 124647247872
However, lets take an example of an NFS mounted external drive
192.168.1.10:/homestorage on /media (nfs, nodev, nosuid, automounted, nobrowse)
php -r "print disk_free_space('/media');"
1879997071360
df /media
Filesystem 512-blocks Used Available Capacity iused ifree %iused Mounted on
192.168.1.10:/homestorage 11604767296 3637930720 7966836576 32% 192244 182620428 0% /media
The results of df 7966836576 * 512
are not even remotely closed to disk_free_space result of 1879997071360
(Note: I did read another SO thread here - but that does not address the issue here, or so I think)
The PHP manual for disk free space says that it doesn't work for "remote files" but what constitutes a remote file? The examples show http urls. In *nix they are mounted as local FS, so what exactly is messing things up and can disk_free_space be reliably used for mounted drives at all?
Thank you.