Avoid using Pathname to detect filename's logical path