RFR: 7038105 - File.isHidden() should return true for pagefile.sys and hiberfil.sys

Rob McKenna rob.mckenna at oracle.com
Fri May 24 15:11:43 UTC 2013

Thanks Alan,

Updated webrev at: http://cr.openjdk.java.net/~robm/7038105/webrev.02/


On 14/05/13 12:21, Alan Bateman wrote:
> On 14/05/2013 02:59, Rob McKenna wrote:
>> Hi folks,
>> Looking for a review of this suggested fix from Fujitsu. 
>> GetFileAttributesExW() returns ERROR_SHARING_VIOLATION for 
>> pagefile.sys and hiberfi.sys so we're falling back to FindFirstFile 
>> instead:
>> http://cr.openjdk.java.net/~robm/7038105/webrev.01/
>>     -Rob
> Thanks for taking this one and removed the crud that is the harding of 
> c:\pagefile.sys.
> Using FindFirstFile when GetFileAttributesExW fails when 
> ERROR_SHARING_VIOLATION is the right approach but it needs an 
> additional check on the attributes to see if they contain a reparse 
> point, otherwise you return the attributes of the reparse point rather 
> than the final file (try it with a symbolic link and you'll see what I 
> mean). When it contains a reparse point then you can use 
> getFileInformation to attempt to open the file (with sharing) and 
> obtain the attributes.
> One other idea is to rename it to getFinalAttributes and move it up to 
> near the top so that it's with the other support functions.
> -Alan.

More information about the core-libs-dev mailing list