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

Brian Burkhalter brian.burkhalter at oracle.com
Wed May 16 23:39:11 UTC 2018


Hi Ivan,

On May 16, 2018, at 2:54 PM, Ivan Gerasimov <ivan.gerasimov at oracle.com> 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 {
    public static void main(String[] args) {
        String name = args.length == 0 ? "C:\\pagefile.sys" : args[1];
        File file = new File(name);
        long length = file.length();
        System.out.format("%s length: %d%n", name, length);
    }
}

> Maybe it is better to compare fileData.cFileName with the pathbuf to make sure we're dealing with the correct file?

I am doubtlessly missing something, but if pathbuf contains wildcards it’s not obvious to me exactly how that would help.

Thanks,

Brian


More information about the core-libs-dev mailing list