<<prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

Utilities/

isafile.pro

same as find except that as long as the file is 'NOT FOUND', isafile calls DIALOG_PICKFILE, to ask the user to select a file.

topisafile io

result = isafile([filein], FILENAME=FILENAME, IODIRECTORY=IODIRECTORY, NEW=NEW, RECURSIVE=RECURSIVE, ONLYPRO=ONLYPRO, ONLYNC=ONLYNC, _EXTRA=_EXTRA)

Return value

the filename with its path

Parameters

filein        in optional

a proposed name. If neither filein input parameter of filename keyword are defined, we ask the user to choose a file.

Keywords

FILENAME       

a proposed filename.

IODIRECTORY       

a directory where we look for the file. this keyword is taken into account only if the dirname of filein or filename is '.'

NEW       

to specify that filename is a new file and that we should check only its path

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.

ONLYPRO       

force to look only at file ending with .pro

ONLYNC       

force to look only at file ending with .nc

_EXTRA       

Used to pass keywords to find, FILE_SEARCH and DIALOG_PICKFILE

Examples

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')

Version history

Version

$Id: isafile.pro 260 2007-08-20 15:24:57Z pinsard $

History

Sebastien Masson (smasson@lodyc.jussieu.fr) 11/2/2000 June 2005: Sebastien Masson: cleaning, use for file_* functions

Statistics

McCabe cyclic 14
McCabe essential 1
McCabe modular design 1
Produced by IDLdoc 2.0.