name Learn; << Update the server copies of ColumnUtility() src from the PC-based copy. This script assumes that you are in the CWD of the PC-copy of colutilcpp. >> sub docopy(localfilename, serverconnection, serverfilename) localfile = open(localfilename); localfile.select(startline: 1, endline: localfile.linecount); localfile.copy(); serverfile = open(connection: serverconnection, filename: serverfilename); serverfile.select(startline: 1, endline: serverfile.linecount); serverfile.delete(); serverfile.paste(); localfile.close(); serverfile.close(forceoverwrite: true); endsub docopy("colutilh", "mpe12", "colutilh"); docopy("colutilcpp", "mpe12", "colutil.src"); docopy("colutil.h", "Rufus", "/users/dev/src/colutil.h"); docopy("colutil.cpp", "Rufus", "/users/dev/src/colutil.c"); << Author: david_greer@robelle.com / bgreen@robelle.com Date: Sept 20, 1999 Web: copy01.qsl Comments: 1. To run this script you will need to have a local copy of 2 source files and host copies as well. Then modify the parameters to docopy() to represent your source file names, connection names and host file names. If that is too much trouble, just study the script to learn how it works. 2. All the details of the file copy are buried in the docopy() sub. You just pass in the local filename, the host connection name, and the host file name. A single file is copied to a single host in each docopy() call. 3. How does docopy() work? 4. First, open() the local file, select() all the lines in it, and copy() them to the clipboard. 5. Next, open() the corresponding host file, select() all the lines in it, delete() them (this step is not actually required, since paste() will replace the current selection), and paste() the new lines from the clipboard. 6. Finally, close() the local file and save the host file with close(forceoverwrite: true). 7. Open Issue: how to detect that the host file does not exist yet and then create it with newfile() and close()? You can't use exists() because that works only on local files. If open() fails, the script aborts. What you need is the Try-Recover feature implemented. >>