Avoid double-checking for file pattern