allow creating read-only files; fixes #2573