From 91ec9ab7ec4dfe28c0991b735656163478de726d Mon Sep 17 00:00:00 2001 From: ddidderr Date: Thu, 4 Aug 2022 18:50:07 +0200 Subject: [PATCH] [fix] log file needs to be opened create + append --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 79958f1..97c424c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -35,7 +35,13 @@ fn print_delete_line(output: &mut StdoutLock) -> LogtimesResult { } fn run() -> LogtimesResult { - let mut log_file = args().nth(1).map(|f| File::create(f).unwrap()); + let mut log_file = args().nth(1).map(|f| { + File::options() + .create(true) + .append(true) + .open(f) + .expect("Could not open log file") + }); let out = stdout(); let mut output = out.lock();