[EMAIL PROTECTED] wrote:
>
> [EMAIL PROTECTED] wrote:
> >
> > Peter Pilgrim wrote:
> > >
> > > I am interesting in getting the disk space and partition
> > > in a Java program by using JNI. What is the std UNIX API
> > > call to do this? I have tried grepping the man pages
> > > and got the source to kdf program but it didn't help
> > > because it was executing `/usr/bin/df -k -T' and parsing
> > > the output. Is there a native portable UNIX system call that
> > > provides partition information and also disk space size and free
> > > information?
> >
Well I found an Volumes API on work Solaris 2.5.1 box
`/usr/include/sys/{mntent.h,mnttab.h}'.
There is a sys structure called `mnttab' which has function called
`getmntent( FILE *, struct mnttab *)' which you can use to
read `/etc/mnttab'.
Can't remember if such an API exists on Linux though.
If so a JNI System Volume info thing is quite doable.
As for disk space usage I 'm still looking ...
--
Adios
Peter
-----------------------------------------------------------------
import std.Disclaimer; // More Java for your Lava, Mate.
"Give the man, what he wants. £££" [on Roy Keane, Quality Player]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]