Refactoring default perms on file to mirror previous functionality before mktemp integration