From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 7B89FBCAE for ; Fri, 1 Jul 2005 20:06:40 +0200 (CEST) Received: from caine.easynet.fr (smarthost163.mail.easynet.fr [212.180.1.163]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j61I6eAg032261 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Fri, 1 Jul 2005 20:06:40 +0200 Received: from asi-62.asi256ip.easynet.fr ([212.180.39.62] helo=micro) by caine.easynet.fr with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DoPuR-00038I-Ov; Fri, 01 Jul 2005 20:06:39 +0200 Received: from gildor by micro with local (Exim 4.50) id 1DoPuF-0006zU-GP; Fri, 01 Jul 2005 20:06:27 +0200 Date: Fri, 1 Jul 2005 20:06:27 +0200 To: Bernd Kuhls Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] How to find out free diskspace? Message-ID: <20050701180627.GA26713@gallu.homelinux.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i From: Sylvain LE GALL X-Miltered: at nez-perce with ID 42C58630.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 le-gall:01 bernd:01 ocaml:01 bindings:01 bernd:01 ...:98 wrote:01 cygwin:01 int:01 string:03 library:03 root:03 solaris:05 jul:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Hello, On Fri, Jul 01, 2005 at 06:28:21PM +0200, Bernd Kuhls wrote: > Hi, > > I am looking for some Ocaml code (or C bindings which work on > Linux/Solaris/Cygwin) to get the amount of free diskspace on a volume. > The function should receive a string and return an int64 value or > something similar. > > Regards, Bernd > Well, i think you can get this information using the C call "statfs" combined with the reading of /etc/mtab, on linux. For windows i remember that you can open some special files at the root of each volume, which should give you information about this... If you find a solution, could you drop me an email, i would like to integrate it in one of my library. Thank you Regard Sylvain Le Gall