Get the empty space on a file system

Olivier Nicole on at
Mon Feb 18 10:25:44 UTC 2008


I am writing a C application that would store files in a directory.

Before it starts storing files, I would like the application to check
is there is enough space in the file system.

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?

Thanks in advance,


More information about the freebsd-questions mailing list