Personal IDL library for M. Galloy

single page | use frames     summary     class     fields     routine details     file attributes


includes main-level program


top mg_check_path

result = mg_check_path(path [, error_path=string])

Check a file path to see if it exists. If not, then can determine which portion of the path is incorrect.

Return value

1 if filepath exists, 0 if not


path in required type=string

filepath to check


error_path out optional type=string

set to a named variable to return the portion of the path which first is is incorrect


Try the main-level example program at the end of this file with:

IDL> .run mg_check_path Path: /Applications/exelis/idl82/lib/unknown_dir/unknown_file.dat Problem: /Applications/exelis/idl82/lib/unknown_dir
The example program does:
IDL> path = filepath('unknown_file.dat', subdir=['lib', 'unknown_dir']) IDL> print, path, format='(%"Path: %s")' Path: /Applications/exelis/idl82/lib/unknown_dir/unknown_file.dat IDL> found = mg_check_path(path, error_path=ppath) IDL> if (~found) then print, ppath, format='(%"Problem: %s")' Problem: /Applications/exelis/idl82/lib/unknown_dir

File attributes

Modification date: Wed May 14 15:07:14 2014
Lines: 17
Docformat: rst rst
Personal library of Michael Galloy
Contact me if you have enhancement requests or bug fixes.