Scenario files in your tree:
If you use tree.walk(), during the entry events, you will end up with test.txt and foo/bar.txt, but for the end event, you will get [foo/bar.txt, foo/bar.txt].
The end handler gives you files in the last tree it recursed through, with a duplicate entry for everything in it.
Scenario files in your tree:
test.txtfoo/bar.txtIf you use
tree.walk(), during theentryevents, you will end up withtest.txtandfoo/bar.txt, but for theendevent, you will get[foo/bar.txt, foo/bar.txt].The
endhandler gives you files in the last tree it recursed through, with a duplicate entry for everything in it.