From 3f52abe434c55f9debcfd1631d49a6e3e3c1461b Mon Sep 17 00:00:00 2001 From: Paul Gossman Date: Mon, 7 Dec 2020 04:33:28 -0500 Subject: [PATCH] Change temp file prefixes to be OS-specific hidden files The previous ".unison." temp file prefix was used on Windows, where hidden files begin with "~$". This change detects if the OS is Windows, and will make temp files properly hidden with a "~$" prefix if so. Unix file prefixes were updated to begin with ".~", which extends support for certain backup applications that sync files beginning with ".", but not ".~". --- src/os.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/os.ml b/src/os.ml index ad27e217e..965b6f2ca 100644 --- a/src/os.ml +++ b/src/os.ml @@ -39,7 +39,11 @@ let serverHostName = localCanonicalHostName let myCanonicalHostName () = if !Trace.runningasserver then serverHostName else Prefs.read clientHostName -let tempFilePrefix = ".unison." +let tempFilePrefix = + match Util.osType with + | `Win32 -> "~$unison." + | _ -> ".~unison." + let tempFileSuffixFixed = ".unison.tmp" let tempFileSuffix = ref tempFileSuffixFixed let includeInTempNames s =