From 4bdbd257b71caee45dcf3de1241ecdd35ac8b0a5 Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 3 Dec 2014 14:50:33 +1000 Subject: file copy: Use binary mode when reading and writing files Matters on Windows Signed-off-by: Steve Bennett --- tclcompat.tcl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tclcompat.tcl') diff --git a/tclcompat.tcl b/tclcompat.tcl index 2a5560c..1509b95 100644 --- a/tclcompat.tcl +++ b/tclcompat.tcl @@ -89,7 +89,7 @@ proc {file copy} {{force {}} source target} { error "bad option \"$force\": should be -force" } - set in [open $source] + set in [open $source rb] if {[file exists $target]} { if {$force eq ""} { @@ -107,7 +107,7 @@ proc {file copy} {{force {}} source target} { return } } - set out [open $target w] + set out [open $target wb] $in copyto $out $out close } on error {msg opts} { -- cgit v1.1