name UpdateFiles group “&Learning” ; -- Copy the contents of fromfile to tofile using the clipboard. We -- This version works even whether the target file exists or not. -- are careful to preserve any existing selections in the from file. sub copyfilecontents(fromfile, tofile) savefromselection = fromfile.selection; fromfile.select(startline: 1, endline: fromfile.linecount); fromfile.copy(); if tofile.linecount > 0 then tofile.select(startline: 1, endline: tofile.linecount); endif tofile.paste(); fromfile.select(range: savefromselection); tofile.select(startline: 1, startcolumn: 1); endsub sub copyfiles(connectionname, filelist) pathname = "c:\personal\robelle\1999\hpworld\scripting\"; repeat for filename in filelist fromfile = open(pathname + filename); tofile = newfile(connection: connectionname); copyfilecontents(fromfile, tofile); tofile.saveas(filename: filename -- give new file this name ,forceoverwrite: true -- ok to purge old ); -- saves file, but does not close it writelog(filename + " copied to " + connectionname); fromfile.close(); tofile.close(); endrepeat endsub sub createfilelist filelist = {}; filelist = filelist + "txtags.h"; filelist = filelist + "txcodes.h"; return filelist endsub on command "MPE Server" list = createfilelist(); copyfiles("MPE", list); endon on command "HP-UX Server" list = createfilelist(); copyfiles("HP-UX", list); endon on command "Both" list = createfilelist(); copyfiles("MPE", list); copyfiles("HP-UX", list); endon << Author: david_greer@robelle.com / bgreen@robelle.com Date: Sept 30, 1999 Name: UpdateFiles Group: Learning Web: copy03.qsl Comments: 1. This script is an expanded version of copy02.qsl 2. You can't really test it unless you have some PC files to update to some hosts and you modify the scripts to point to your local path and your connection names. 3. This script differs from copy02.qsl in one ways. It gets around the problem in copy02.qsl and copy01.qsl that the host tofile must already exist. It does this by creating a Newfile() and then doing a SaveAs() on it, instead of doing an Open() on an existing file. >>