Use the right file modes