Skip to content

Commit

Permalink
Change temp file prefixes to be OS-specific hidden files
Browse files Browse the repository at this point in the history
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 ".~".
  • Loading branch information
pgossman committed Dec 15, 2020
1 parent 4962004 commit 3f52abe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/os.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 3f52abe

Please sign in to comment.