diff --git a/src/apps/user.rs b/src/apps/user.rs index a778673..c22a75c 100644 --- a/src/apps/user.rs +++ b/src/apps/user.rs @@ -113,9 +113,10 @@ impl MimeApps { pub fn read() -> Result { let raw_conf = { let mut buf = String::new(); + let exists = std::path::Path::new(&Self::path()?).exists(); std::fs::OpenOptions::new() - .write(true) - .create(true) + .write(!exists) + .create(!exists) .read(true) .open(Self::path()?)? .read_to_string(&mut buf)?;