Save a step by writing the file mode when opening instead of using File.chmod