From 6fd99efa90ade72fecd0d0939e2a43a97936ce2c Mon Sep 17 00:00:00 2001 From: Vince Darley Date: Tue, 14 Aug 2001 15:50:24 +0000 Subject: [PATCH] binary file support --- library/ftpvfs.tcl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/ftpvfs.tcl b/library/ftpvfs.tcl index d0ba11a..5775ef2 100644 --- a/library/ftpvfs.tcl +++ b/library/ftpvfs.tcl @@ -138,9 +138,17 @@ proc vfs::ftp::open {fd name mode permissions} { proc vfs::ftp::_closing {fd name filed action} { seek $filed 0 set contents [read $filed] + set trans [fconfigure $filed -translation] + if {$trans == "binary"} { + set oldType [::ftp::Type $fd] + ::ftp::Type $fd binary + } if {![::ftp::$action $fd -data $contents $name]} { error "Failed to write to $name" } + if {[info exists oldType]} { + ::ftp::Type $fd $oldType + } } proc vfs::ftp::_findFtpInfo {fd name} { -- 2.23.0