title: What does java.io.File.length() return for a directory?
body: <p>The javadoc for java.io.File.length() states:</p>
  
  <blockquote>
    <p>Returns the length of the file denoted by this abstract pathname. The return value is unspecified if this pathname denotes a directory. </p>
  </blockquote>
  
  <p>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. </p>
  
  <p>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!</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>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. </p>
  
  <p>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).</p>