Need reviewer for 6926800: TEST_BUG: java/nio/file/Files/walk_file_tree.sh fails with newer versions of find(1)
Rémi Forax
forax at univ-mlv.fr
Sat Feb 20 11:27:57 PST 2010
Le 20/02/2010 19:15, Alan Bateman a écrit :
>
> The test test/java/nio/file/Files/walk_file_tree.sh is failing on some
> Linux distributions. The test walks a file tree and checks that it
> visits directories and files in the same order as the find(1) utility.
> To make things interesting the test creates a file tree with cycles
> (sym links to ancestor directories) and checks behavior for the case
> where sym links are followed and not followed. When comparing the
> output with the output of find(1), the test assumes that when a cycle
> is encountered that find will print the sym link and continue (the
> warning to stderr is ignored). This assumption turns out to be no
> longer true on some distributions where find now just prints a
> warning. The fix proposed changes the test so that it works with
> either behavior - it first walks the file tree without reporting
> cycles. If that doesn't match the output of find then it walks the
> file tree again with an option to print cycles. I've put the webrev
> with the proposed change here:
> http://cr.openjdk.java.net/~alanb/6926800/webrev.00/
>
> Thanks,
> Alan.
This is my first review with a switch on string :)
The patch is ok.
I think that the doc of visitFile should be modified to add
a sentence about the fact that visiFile can be called with
a link to a directory.
The fact that attrs.isDirectory() can be true is surprising.
Rémi
More information about the nio-dev
mailing list