The javadoc for java.io.File.length() states:
Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory.
I've been testing on Solaris which seems to be based on the number of files in the directory, but it always returns a greater number than there are files\folders including '.' files.
Does anyone know what this value means on Solaris\Linux\OSX\Windows? It's probably OS specific but it would be good to know if it has any value at all!
EDIT:
I agree with the comments which have advised that this is not a feature which should be used for the "Write Once, Run Anywhere" Java methodology, however since the value returned is not 0L (which it might be on some OS's but not Solaris) i'm interested in knowing what the value does refer to.
The native Java calls are usually direct single OS procedures so whatever the value refers to has some meaning and you get it for free without needing to load more java.io.File(s).