aboutsummaryrefslogtreecommitdiff
path: root/tclcompat.tcl
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2014-12-03 14:50:33 +1000
committerSteve Bennett <steveb@workware.net.au>2014-12-04 10:23:17 +1000
commit4bdbd257b71caee45dcf3de1241ecdd35ac8b0a5 (patch)
tree0a38e7db9753b872f85abb36e7c2fa3ae2e34188 /tclcompat.tcl
parent86c6f3c6b20f7120617c6c0c3fc799bee0a889cb (diff)
downloadjimtcl-4bdbd257b71caee45dcf3de1241ecdd35ac8b0a5.zip
jimtcl-4bdbd257b71caee45dcf3de1241ecdd35ac8b0a5.tar.gz
jimtcl-4bdbd257b71caee45dcf3de1241ecdd35ac8b0a5.tar.bz2
file copy: Use binary mode when reading and writing files
Matters on Windows Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tclcompat.tcl')
-rw-r--r--tclcompat.tcl4
1 files changed, 2 insertions, 2 deletions
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} {