JDK-6348207 : File.length() reports a length of 0 for special files hiberfil.sys and pagefile.sys (win)
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-11-09
  • Updated: 2010-05-11
  • Resolved: 2006-02-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other JDK 6
5.0u8Fixed 6 b73Fixed
Description
J2SE Version (please include all output from java -version flag):
 1.6.0-b59


Does this problem occur on J2SE 1.4.x or 5.0.x ?  Yes / No (pick one)
 No.


Operating System Configuration Information (be specific):
 Windows XP Service Pack 2
 Hibernation enabled
 Virtual memory enabled


Bug Description:
  java.io.File reports a length of 0 for the special
 Windows files C:\hiberfil.sys and C:\pagefile.sys




Steps to Reproduce (be specific):
  Create java.io.File instances for the hibernation file
  "C:\hiberfil.sys" and the paging file "C:\pagefile.sys".
  Check the file length using File#length().

Here's source code to reproduce the problem:

public class FileBug {

     public static void main(String[] args) {
         java.io.File hiberfil = new java.io.File("C:\\hiberfil.sys");
         java.io.File pageFile = new java.io.File("C:\\pagefile.sys");

         System.out.println("hiberfil.sys length=" + hiberfil.length());
         System.out.println("pagefile.sys length=" + pageFile.length());
     }

}

Comments
EVALUATION regression, need to address in mustang
14-01-2006