FUNCTION file_check, error, filename ;;;, status ;; Quick little procedure to detect whether or not a file ;; exists. To use the procedure: Open a file in another ;; procedure as follows (eg): OPENR, 10, filename, ERROR = error ;; Then call this procedure: file_check, error, filename, status ;; status=0 (FALSE) if the file cannot be opened, status=1 (TRUE) ;; otherwise. -- CB, 5/21,97 IF (N_PARAMS() NE 2) THEN BEGIN PRINT,' ' PRINT,' file_check USAGE: ' PRINT,' ' PRINT,' file_check, error, filename ' PRINT,' ' RETURN, -1 ENDIF FALSE = 0 TRUE = 1 IF (error NE 0) THEN BEGIN PRINT,' ' PRINT,' file_check.pro: Error opening file! ' PRINT,' Filename=' + filename PRINT,' ' status = FALSE ENDIF ELSE BEGIN status = TRUE ENDELSE RETURN, status END