Do not pass quoted file name to dirname() to get cwd