From 8360f30dfcbcf79b9a0ccea3b4d2bdaf5a3a7428 Mon Sep 17 00:00:00 2001 From: Manuel Coenen Date: Mon, 1 Jul 2019 13:12:23 +0200 Subject: [PATCH] Fix overwriting of rfm.conf on Windows --- config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.go b/config.go index bffcafa..ec944d4 100644 --- a/config.go +++ b/config.go @@ -137,6 +137,9 @@ func SaveConfigs() error { return err } + // Explicitely close the file before renaming + f.Close() + // If we get here rename the temporary file to the real name return os.Rename(f.Name(), filepath.Join(h, ConfigFileName)) }