Version 9 of fcopy

Updated 2006-05-08 18:23:44

http://purl.org/tcl/home/man/tcl8.4/TclCmd/fcopy.htm

fcopy provides the developer the ability to copy data from an input channel to an output channel, either synchronously or in the background, using fileevents to schedule activity.


LV Does anyone have some sample code to demonstrate some tcl best practices concerning writing async code using fcopy to copy files ? Maybe for instance the example could loop through 3 machines doing an fcopy of a file like /tmp/motd?

What I'm after is some examples of the type of code doing error checking for things like machines not available, out of disk space, etc - all the sort of things that if one is trying to write a 'safe' application one would do.


LV In April, 2005, on comp.lang.tcl, a thread titled fcopy problem was discussing problems using fcopy on large binary files between channels. The fcopy appeared to be losing bytes.

The original poster was using -encoding binary, because the documentation said that this will then assign no interpretation to the data in the file and simply read or write raw bytes. However, DKF suggested changing to use -translation binary instead. The original poster followed up that making that change indeed sorted out his problem.


dzach 2006-5-8 Hmm... After spending a day trying to make a bidirectional copy between two open sockets, I wonder if something like fcopy -bidirectional sock1 sock2 is possible with fcopy as it stands today.


Tcl syntax help - Arts and crafts of Tcl-Tk programming - Category Command - Category File