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

Rob McKenna rob.mckenna at oracle.com
Fri May 24 16:50:16 UTC 2013


http://cr.openjdk.java.net/~robm/7038105/webrev.03/

     -Rob

On 24/05/13 16:48, Alan Bateman wrote:
> On 24/05/2013 16:11, Rob McKenna wrote:
>> Thanks Alan,
>>
>> Updated webrev at: http://cr.openjdk.java.net/~robm/7038105/webrev.02/
>>
>>     -Rob
> This looks much better except that I assume it should only fallback to 
> FindFirstFileW if the error is ERROR_SHARING_VIOLATION. If I read it 
> correctly then it will do the fallback for every error, say the file 
> doesn't exist.
>
> -Alan
>
>
>>
>> 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