RESOPEN Name
RESOPEN Purpose
Open a results file for reading or writing.
Category
Calling Sequence
resopen, file Inputs
file = results data file name. in
Keyword Parameters
Keywords
/WRITE means open file for write.
/APPEND used with /WRITE to append to a file.
/XDR means use XDR.
FD=fd Returned file descriptor if opened successfully.
May pass in FD=fd to the other res file routines to
allow multiple res files to be in use at once. if FD
keyword used resopen will not close any open res files.
HEADER=h returned header array on open for read.
FSTAT=fst returned file status structure.
ERROR=e error code:
0 = OK.
1 = File not found.
2 = File not a results file.
3 = File not opened.
TEXT_ERROR=txterr returned error message.
/QUIET means don't display any error messages.
/SWAP force endian swap.
/NOSWAP force no endian swap.
Endian should be detected automatically and corrected.
Outputs
Common Blocks
results_common Notes
Notes: one of the results file utilities.
See also resput, resget, rescom, resclose.
Using a file descriptor, fd, allows multiple res files
to be in use. Pass fd to a routine through the FD keyword.
If FD=fd is not used then the last res file accessed, if
any, will be used. This may cause an error, so if fd is
used at all use it for all calls in the idl session.
Modification History
R. Sterner, 5 Jun, 1991
R. Sterner, 2 Jan, 1992 --- added def='.' to open*
R. Sterner, 1994 Jun 22 --- Added automatic close of an open file.
R. Sterner, 1994 Jul 26 --- Modified automatic close.
R. Sterner, 1994 Aug 11 --- Made sure r_open was defined.
R. Sterner, 1994 Sep 12 --- Added /APPEND.
R. Sterner, 1994 Sep 27 --- Fixed /XDR openu problem.
R. Sterner, 2000 Mar 08 --- Fixed test for res file to compute expected file size.
R. Sterner, 2000 Apr 11 --- Handled endian problem.
R. Sterner, 2004 Feb 10 --- Used resclose to close any open res file.
R. Sterner, 2004 Feb 10 --- Supported extended file pointer (LONG64).
R. Sterner, 2004 Feb 16 --- Fixed to deal with endian before file pntr.
R. Sterner, 2004 Sep 27 --- Added FD=fd to return file descriptor.
R. Sterner, 2004 Sep 30 --- Fixed r_swap flag on resopen,/write.
Also checked if file already open.
R. Sterner, 2005 Feb 03 --- Made /QUIET apply to file already open.
Also made this case a warning (not error) and returned err=0.
R. Sterner, 2007 Sep 12 --- Corrected help text layout.
R. Sterner, 2010 May 23 --- Converted arrays from () to [].
Copyright (C) 1991, Johns Hopkins University/Applied Physics Laboratory
This software may be used, copied, or redistributed as long as it is not
sold and this copyright notice is reproduced on each copy made. This
routine is provided as is without any express or implied warranties
whatsoever. Other limitations apply as described in the file disclaimer.txt.