NAME: filecopy PURPOSE: Copy one file to a new place or name. DESCRIPTION: This routine is meant to provide a common capability of copying files regardless of the operating system. The full suite of possibilities that each OS can support is _not_ supported on all platforms. In fact, there is not even a full range of parameter validation to ensure the use of universal features. Instead, you can get this to work on all platforms only if you keep it simple. Note that this routine does NOT check to see if the destination already exists. That means this routine will quietly overwrite preexisting files. Here are some examples of things that should work: filecopy,'file1.dat','file1copy.dat' Copy file1.dat to file1copy.dat in the current directory. filecopy,'file1.dat','other' If other is a directory, this will create file1.dat in that directory If other is a file or does not exist, then other will be a copy of file1.dat upon completion. filecopy,'*.dat','other' Copy all files ending in .dat to the directory "other". If other is not a directory or does not exist, this will fail. If you use directory separators (eg., / or \ or : ), you will not be able to move that call of filecopy to another platform. Note that the oldfile/newfile inputs can also be string arrays but they must match in length. The lists are matched, one-by-one as if filecopy were being called on each string array element pair in turn. CATEGORY: Utility CALLING SEQUENCE: filecopy,oldfile,newfile INPUTS: oldfile - Filename of file that exists newfile - Name of file to copy to. OPTIONAL INPUT PARAMETERS: KEYWORD INPUT PARAMETERS: SILENT - If set, suppresses all chatty output to the screen. OUTPUTS: KEYWORD OUTPUT PARAMETERS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: MacOs only: Unable to copy a file at the top level of a disk partition PROCEDURE: MODIFICATION HISTORY: Written by Marc W. Buie, Lowell Observatory, and Dave Osip, MIT, 99/07/18 verified on MacOS 9 to work for all cases indicated above 2000/03/19 2001/09/26, MWB, added -p flag to Unix cp command.