[cp-patches] FYI: added missing 1.6 File methods

Mario Torre neugens at limasoftware.net
Tue Nov 6 13:10:40 UTC 2007

I'm committing this patch. A mauve test will follow as soon as I figure
out a way to get a valid result for comparison (I'm thinking about using
df here, but may not work well an all systems).

The method was tricky because it seems that statvfs does not work
equally well on all system, so I expect few bug reports on this one.
Tested on Linux, should work at least on Solaris, AIX and MacOSX (and
maybe other *BSD), testing on these platform is welcomed (or you can buy
me a playstation 3 and an imac and I will test by myself :)

The return value is in line with the jdk, but with a small difference.
When the root user asks for available space, free space is returned
instead. This is obvious since root has reserved space in addition to
system space. OpenJDK does not take into account this difference. I
don't see a problem here because the returned number of bytes is
explicitly stated to be used as an "hint".

2007-11-06  Mario Torre  <neugens at limasoftware.net>

	* vm/reference/java/io/VMFile.java: 
	(getTotalSpace): new method.
	(getUsableSpace): likewise.
	(getFreeSpace): likewise.
	* java/io/File.java: (getTotalSpace): new method. 
	(getUsableSpace): likewise.
	(getFreeSpace): likewise.
	* native/jni/java-io/java_io_VMFile.c:
	(Java_java_io_VMFile_getTotalSpace): new function.
	(Java_java_io_VMFile_getFreeSpace): likewise.
	(Java_java_io_VMFile_getUsableSpace): likewise.
	* native/jni/native-lib/cpio.h: (cpio_df): new function.
	(CPFILE_DF_TYPE): enum type for cpio_df.
	* native/jni/native-lib/cpio.c: (cpio_df): new function.
	* include/java_io_VMFile.h: regenerated.
	* configure.ac: added check for statvfs.
Lima Software - http://www.limasoftware.net/
GNU Classpath Developer - http://www.classpath.org/
Fedora Ambassador - http://fedoraproject.org/wiki/MarioTorre
Jabber: neugens at jabber.org
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

Please, support open standards:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2007-11-06.patch
Type: text/x-patch
Size: 11120 bytes
Desc: not available
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20071106/e72f1d2c/2007-11-06.bin

More information about the Classpath-patches mailing list