The code does not do what the documentation says it does. The documentation/API method implies just ignoring filenames (i.e. not directories), but the code ignores on substrings of the full, absolute file path.