; docformat = 'rst' ; ; NAME: ; FILE_EXIST ; PURPOSE: ; This function tests for the presence of a file. ; ;+ ; :Description: ; This function tests for the presence of a file. ; ; :Categories: ; Disk I/O ; ; :Params: ; FILE: in, required, type=string ; String holding the name of the file you want to test ; the existence of. ; ; :Returns: This function returns 1 if the specified file exists or ; 0 if the specified file does NOT exist. ; ; :Examples: ; To check the existence of the file /etc/services:: ; IDL > if (file_exist("/etc/services")) then begin ; IDL > print,'/etc/services exists' ; IDL > endif ; ; :Author: ; Joern Wilms ; :History: ; Change History:: ; Written in October 1997, Joern Wilms ; 2013-Nov.: B.Carry (IMCCE) - IdlDoc Header ;- function file_exist, FILE openr,unit,file,/get_lun,error=err IF (err EQ 0) THEN free_lun,unit return,(err EQ 0) END