Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-22 Thread Brian Burkhalter
On May 21, 2018, at 10:51 PM, Ivan Gerasimov wrote: > Thank you Brian, this looks good to me. > > I assume it compiles Okay, though according to MSDN wcsrchr() and wcscmp() > require either or to be included (must have been added > through one of already included header). > > No need for ano

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-21 Thread Alan Bateman
On 22/05/2018 01:43, Brian Burkhalter wrote: Updated webrev: http://cr.openjdk.java.net/~bpb/8202076/webrev.03/ This version checks for a reparse point and looks right. Just some odd formatting at L540/541 that I assume you'll fix but othe

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-21 Thread Ivan Gerasimov
Thank you Brian, this looks good to me. I assume it compiles Okay, though according to MSDN wcsrchr() and wcscmp() require either or to be included (must have been added through one of already included header). No need for another webrev if you decide to add one of these. With kind regards

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-21 Thread Brian Burkhalter
Updated webrev: http://cr.openjdk.java.net/~bpb/8202076/webrev.03/ On May 18, 2018, at 4:49 PM, Ivan Gerasimov wrote: > I minor suggestion is that I would recommend to use L'\\' to explicitly > indicate it is a wide char literal. Changed as suggested. > And the last comment: Maybe it makes s

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-21 Thread Brian Burkhalter
On May 18, 2018, at 11:20 PM, Alan Bateman wrote: > On 18/05/2018 23:08, Brian Burkhalter wrote: >> : >> Here is another version which incorporates your suggestion: >> >> http://cr.openjdk.java.net/~bpb/8202076/webrev.02/ >> > GetFileAttributesEx follows sym links, FindFirstFile does not. You

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Alan Bateman
On 18/05/2018 23:08, Brian Burkhalter wrote: : Here is another version which incorporates your suggestion: http://cr.openjdk.java.net/~bpb/8202076/webrev.02/ GetFileAttributesEx follows sym links, FindFirstFile does not. You should be able to quickly check it but I think the patch means that i

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Brian Burkhalter
Hi Ivan, All good ideas for next week! Thanks, Brian On May 18, 2018, at 4:49 PM, Ivan Gerasimov wrote: > Thanks Brian, the last webrev looks good to me! > > I minor suggestion is that I would recommend to use L'\\' to explicitly > indicate it is a wide char literal. > > And the last comme

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Ivan Gerasimov
Thanks Brian, the last webrev looks good to me! I minor suggestion is that I would recommend to use L'\\' to explicitly indicate it is a wide char literal. And the last comment: Maybe it makes sense to update the test java/io/File/WinSpecialFiles.java to make sure we deal correctly with wil

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Brian Burkhalter
Hi Ivan, On May 18, 2018, at 2:30 PM, Brian Burkhalter wrote: > On May 18, 2018, at 2:24 PM, Ivan Gerasimov wrote: > >> In fact, we only need to check that that only file name (without the >> directory name) is the same, so maybe it will be safer to compare the >> substrings starting at the

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Brian Burkhalter
Hi Ivan, On May 18, 2018, at 2:24 PM, Ivan Gerasimov wrote: > In fact, we only need to check that that only file name (without the > directory name) is the same, so maybe it will be safer to compare the > substrings starting at the very last backslash? > If the check fails, then we may want to

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Ivan Gerasimov
Hi Brian! On 5/18/18 12:18 PM, Brian Burkhalter wrote: On May 18, 2018, at 7:42 AM, Brian Burkhalter wrote: On May 18, 2018, at 7:40 AM, Alan Bateman wrote: The offset in the string comparison is necessary as “C:\\pagefile.sys” becomes “pagefile.sys” in fileData.cFileName. I’m not certa

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Brian Burkhalter
On May 18, 2018, at 7:42 AM, Brian Burkhalter wrote: > On May 18, 2018, at 7:40 AM, Alan Bateman wrote: > >>> The offset in the string comparison is necessary as “C:\\pagefile.sys” >>> becomes “pagefile.sys” in fileData.cFileName. I’m not certain that this >>> will work in all cases however

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Brian Burkhalter
On May 18, 2018, at 7:40 AM, Alan Bateman wrote: >> The offset in the string comparison is necessary as “C:\\pagefile.sys” >> becomes “pagefile.sys” in fileData.cFileName. I’m not certain that this will >> work in all cases however but it is certainly no worse than before. >> > Can the call t

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-18 Thread Alan Bateman
On 17/05/2018 01:56, Brian Burkhalter wrote: Hi Ivan, On May 16, 2018, at 2:54 PM, Ivan Gerasimov wrote: Maybe it is better to compare fileData.cFileName with the pathbuf to make sure we're dealing with the correct file? Certainly making this change to the previous proposal would do no ha

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-16 Thread Brian Burkhalter
Hi Ivan, On May 16, 2018, at 2:54 PM, Ivan Gerasimov wrote: > Maybe it is better to compare fileData.cFileName with the pathbuf to make > sure we're dealing with the correct file? Certainly making this change to the previous proposal would do no harm: --- a/src/java.base/windows/native/libjav

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-16 Thread Brian Burkhalter
Hi Ivan, On May 16, 2018, at 2:54 PM, Ivan Gerasimov wrote: > I wonder if FileSystem.getLength() will start to return the file size when > the file name contains wildcards? Interesting point. A simple program verifies that this is the case: import java.io.File; public class FileLength {

Re: 8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-16 Thread Ivan Gerasimov
Hi Brian! I wonder if FileSystem.getLength() will start to return the file size when the file name contains wildcards? Maybe it is better to compare fileData.cFileName with the pathbuf to make sure we're dealing with the correct file? With kind regards, Ivan On 5/16/18 2:37 PM, Brian Burk

8202076: test/jdk/java/io/File/WinSpecialFiles.java on windows with VS2017

2018-05-16 Thread Brian Burkhalter
https://bugs.openjdk.java.net/browse/JDK-8202076 http://cr.openjdk.java.net/~bpb/8202076/webrev.00/ If all else fails, obtain the file length via the FindFirstFileW function [1]. Thanks, Brian [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa364418(v=vs.85).aspx