From: Vince Darley Date: Tue, 14 Aug 2001 15:50:24 +0000 (+0000) Subject: binary file support X-Git-Tag: vfs-1-2~125 X-Git-Url: http://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=6fd99efa90ade72fecd0d0939e2a43a97936ce2c;p=tclvfs binary file support --- 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} {