Use io::Truncate instead of io::Open for file mode.