Get the empty space on a file system

Heiko Wundram (Beenic) wundram at
Mon Feb 18 10:29:48 UTC 2008

Am Montag, 18. Februar 2008 11:25:39 schrieb Olivier Nicole:
> How to:
> 1) knowing the name of the directory, how toknow the file system it
>    belongs to (not considering symbolic links, I can decide that the
>    directory is always a real path);
> 2) knowing the file system from 1), how to check the remaining space
>    in the file system?

man 2 statfs
man 2 statvfs

The former is freebsd-specific, though (AFAIK); the latter is portable (i.e., 
POSIX), but might return garbage (which is also indicated in the man-page for 

Heiko Wundram
Product & Application Development

More information about the freebsd-questions mailing list