For Programmers: Free Programming Magazines  


Home > Archive > Tcl > March 2008 > Re: serving a file to a client --- background fcopy read fileevent









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: serving a file to a client --- background fcopy read fileevent
vitick@gmail.com

2008-03-29, 7:28 pm

Thanks everyone for your replies. It is very enlightening.

I read the manual for fcopy and duplicated the second example exactly
as it is on the page and it worked.
I was trying to run my previous code like this (simplified}:

set check 1
while {$check} {
fcopy $in $out -command [list CopyMore $in $out] -size 1024
}

proc CopyMore {in out args} {
if {[eof $in]} {set check 0; close $in}
}

I thought that it worked the way "read" command works, by reading from
where it left of but instead I was getting a "file busy" error.
I am still not sure why my code did not work.

I was able to simulate fcopy with TCL commands by using variable
trace. And it was a very good exercise. :)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com