From: drscrypt on
Hrachya.Aghajanyan(a)gmail.com wrote:
> I simplified the code a bit and now can get the file on the server in
> the original size.
>
> ################ Server ########################
> proc receive_file { dir sock addr port } {
> gets $sock gzip_file
> gets $sock datasize
> puts "Receiving file: $gzip_file($datasize)"
> fconfigure $sock -translation binary -buffering none
>
> set fid [open "$dir/layout.tar.gz" w]
> fconfigure $fid -translation binary -buffering none -eofchar ""
>
> while {[gets $sock line] >= 0} {
> puts $fid "$line"
> }
> flush $fid
> close $fid
> fconfigure $sock -translation auto -buffering line
> }
>


You are not using the file name or the size - Is there a technical
reason for including them as the first line during the file
transmission? Same thing goes for the sender.


DrS