From owner-freebsd-questions@FreeBSD.ORG Mon Feb 18 10:25:44 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50EBC16A418 for ; Mon, 18 Feb 2008 10:25:44 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.freebsd.org (Postfix) with ESMTP id A495413C4D3 for ; Mon, 18 Feb 2008 10:25:43 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.13.1/8.12.11) with ESMTP id m1IAPdrL095309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 18 Feb 2008 17:25:39 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.13.6/8.12.11) id m1IAPdHc060834; Mon, 18 Feb 2008 17:25:39 +0700 (ICT) Date: Mon, 18 Feb 2008 17:25:39 +0700 (ICT) Message-Id: <200802181025.m1IAPdHc060834@banyan.cs.ait.ac.th> From: Olivier Nicole To: freebsd-questions@freebsd.org X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Subject: Get the empty space on a file system X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2008 10:25:44 -0000 Hi, 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, olivier