NAME: isafile
PURPOSE: same as find.pro except that as long as the file is 'NOT FOUND',
isafile calls dialog_pickfile, to ask the user to select a file.
CATEGORY: io
CALLING SEQUENCE:filename = isafile([filein])
INPUTS:optional:a proposed name. If neither filein
input parameter of filename keyword are defined,
the ask the user to choose a file.
KEYWORD PARAMETERS:
FILENAME: a proposed filename.
IODIRECTORY: a directory where we look for the file. this
keyword is taken into account only if the dirmame
of filein or filename is '.'
/NEW:to specify that filename is a new file and that
we should check only its path
ONLYPRO:force to look only at file ending with .pro
ONLYNC:force to look only at file ending with .nc
RECURSIVE: performs recursive searching of directory hierarchies.
In a recursive search, find looks recursively for any and all
subdirectories in the file hierarchy rooted at the IODIRECTORY
argument.
all find, file_search and dialog_pickfile keywords (like title)
OUTPUTS:the filename with its path
COMMON BLOCKS:none
SIDE EFFECTS:
RESTRICTIONS:
EXAMPLE:
IDL> print, isafile('/Users/sebastie/SAXO_RD/Commons/cm_4mesh.pro')
/Users/sebastie/SAXO_RD/Commons/cm_4mesh.pro
IDL> print, isafile('cm_4mesh.pro', iodir = '/Users/sebastie/SAXO_RD/Commons')
/Users/sebastie/SAXO_RD/Commons/cm_4mesh.pro
IDL> print, isafile('cm_4mesh.pro', iodir = !path)
/Users/sebastie/SAXO_RD/Commons/cm_4mesh.pro
IDL> print, isafile('cm_4mesh.pro', iodir = '/Users/sebastie/SAXO_RD', /recursive)
/Users/sebastie/SAXO_RD/Commons/cm_4mesh.pro
IDL> print, isafile('cm_4mesh.pro', iodir = getenv('HOME'), /recursive)
/Users/sebastie/SAXO_RD/Commons/cm_4mesh.pro
IDL> print, isafile('fake_file.pro')