MGH_FILE_COPY
Name
MGH_FILE_COPY
Purpose
This procedure reads the contents of a file & writes them to
another file.
Calling Sequence
MGH_FILE_COPY, InFile, OutFile
Positional Parameters
infile (input, scalar string)
Input file name.
outfile (input, scalar string)
Output file name.
Keyword Parameters
BUFSIZE (input, scalar integer)
This keyword has an effect only when the TEXT keyword *is not*
set. It specifies the size (in bytes) of chunks read &
written. Default is 2^16 (64kiB)
GUNZIP (input, logical)
If this keyword is set, read compressed data.
GZIP (input, logical)
If this keyword is set, write compressed data.
TEXT (input, logical)
If this keyword is set, treat the file as a text file,
transferring data line-by-line with formatted
read/writes. Otherwise, transfer data via a buffer with
unformatted read/writes of byte data.
UNIX (input, logical)
This keyword has an effect only when the TEXT keyword *is*
set. When UNIX is set, the lines of text are written via
unformatted writes terminated with a 10B character. Thus
Unix-format files are produced on all platforms.
Side Effects
A new file is created.
###########################################################################
Copyright (c) 2013 NIWA:
http://www.niwa.co.nz/
Licensed under the MIT open source license:
http://www.opensource.org/licenses/mit-license.php
###########################################################################
Modification History
Mark Hadfield, 1997-01:
Written.
Mark Hadfield, 1999-09:
Added GZIP, GUNZIP & TEXT functionality.
Mark Hadfield, 2000-08:
With the move to version 5.4, removed BINARY keyword in calls
to OPENR & OPENW. this should make the procedure portable to
non-Windows platforms.
Mark Hadfield, 2000-10:
Worked around EOF bug in IDL 5.4 beta by changing EOF to
MGH_EOF (which see).
Mark Hadfield, 2000-11:
EOF bug fixed in IDL 5.4 final so MGH_EOF changed back to
EOF.
Mark Hadfield, 2001-07:
Updated for IDL 5.5.
Mark Hadfield, 2002-11:
Added YIELD keyword--yielding is done via an MGH_Waiter object.
Mark Hadfield, 2003-01:
Yielding is now turned on by default and is done via a call to
widget_event.
Mark Hadfield, 2005-02:
Fixed bug: binary NOT operator used when the LOGICAL_PREDICATE
compile option is in effect.
Mark Hadfield, 2009-10:
Removed YIELD functionality.
Mark Hadfield, 2011-08:
Added GUNZIP functionality.
Mark Hadfield, 2012-01:
Added BUNZIP2 functionality.
Mark Hadfield, 2013-06:
Increased BUFSIZE default from 64kiB to 256 kiB in an attempt
to improve speed of transfers from HPCF.
Mark Hadfield, 2014-07:
REvised source indentation