I don't have an explanation for the discrepancy, but here are some tips to get more debug information. Before your
; you expect the 1st file to exist, but the 2nd not to exist, right? For each file that exists, inspect the info returned by
. Do the same for the directories to get permission info.