Set proper file mode