Re: Get Free Disk Space in Java

From: Stefan Kaczmarek <stefan_at_thezonie.org>
Date: Fri, 13 Apr 2007 15:19:06 -0700

I don't know ... You can't see amount of disk space available, and
you can't even specify a file size explicitly (not that I can see,
anyway).

Most work-arounds involved running platform specific execs() or
scripts or something and then parsing the results.

(Quite ass.)

I've put Java 6 on my box, but I still have the old ones available,
so I can switch back if needed.

- Z

On Apr 13, 2007, at 3:06 PM, Jay Mairs wrote:

> Can you check to see if X amount of disk space is available? Or do
> you
> just create a file and hope for the best? (in the older Java version)
>
> -----Original Message-----
> From: Stefan Kaczmarek [mailto:stefan_at_thezonie.org]
> Sent: Friday, April 13, 2007 3:03 PM
> To: Ivan Kwok; Ben Ebert; Ty Heath; Jay Mairs; Sergio Alvarez; Dylan
> Douglas
> Subject: Get Free Disk Space in Java
>
> So, there was really no way to get the free disk space of a disk in
> Java until Java 1.6, which is the latest.
>
> For Mac OS X, there is only a Developer Preview Release 1 of Java 6
> available.
>
> Is this sufficient to do development on? I mean, I guess if it works,
> that's okay, I guess.
>
> Up until now I've been using Java 5.
>
> This point is moot, really, unless there is some other way of
> calculating free disk space, like just trying to create bigger and
> bigger files until things explode. (Which is somewhat ass.)
>
> I'm doing this for the tivo logic's whole "use a % of the total free
> space".
>
> - Z
Received on Fri Sep 14 2007 - 10:56:04 BST

This archive was generated by hypermail 2.2.0 : Sun Sep 16 2007 - 22:19:48 BST