path procs

This page was created by the IDL library routine mk_html_help. For more information on this routine, refer to the IDL Online Help Navigator or type:

     ? mk_html_help

at the IDL command line prompt.

Last modified: Tue Dec 20 11:48:26 2005.


List of Routines


Routine Descriptions

ADDPATH -- ADD A PATH TO THE !PATH IDL ENVIRONMENT SYSTEM VARIABLE.

[Next Routine] [List of Routines]
 NAME:
ADDPATH -- add a path to the !path idl environment system variable.
     
 PURPOSE:
       To add a path to the !PATH IDL environment system variable. 
     
 EXPLANATION:
       !PATH is a string variable listing the directories IDL will search 
       for libraries, include files, and executive commands.  This
       routine allows the user to add a new path to !PATH.  If a
       directory already exists in !PATH, then this directory is moved
       to the front of !PATH.
     
 CALLING SEQUENCE:
       ADDPATH, Newpath [,/EXPAND][,/ALL_DIRS]
     
 INPUTS:
       NEWPATH : The string containing the name of the directory to be
                 added to !PATH.  If the directory specified in the string 
                 does not have a "+" character prepended to it, it is 
                 copied to the output string verbatim. However, 
                 if it does have a leading "+" then EXPAND_PATH searches 
                 the directory and all of its subdirectories for files of 
                 the appropriate type for the path. This can be accomplished 
                 by setting the EXPAND keyword also.
     
 OUTPUTS:
       None.

 KEYWORDS:
       /EXPAND : Default is for ADDPATH not to expand the added directory. 
                 If this keyword is set, any directory below the specified 
                 directory is added to the path if it contains an IDL file 
                 (either a .pro or a .sav file.) Setting this keyword is 
                 equivalent to prepending a "+" to the directory to be added.

       /ALL_DIRS : Set this keyword to return all directories without 
                   concern for their contents, otherwise, EXPAND_PATH 
                   only returns those directories that contain .pro or 
                   .sav files.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       !PATH system variable is changed.

 EXAMPLES:
       Suppose you have a directory with no .pro or .sav files in it,
       and you'd like to add this, and only this, directory to !path:

       IDL> addpath, '/hvc/robishaw/hvc', /ALL_FILES

       To add all the directories below /hvc/robishaw/hvc regardless of
       whether any has a .pro or .sav file, either of the following
       will work:

       IDL> addpath, '/hvc/robishaw/hvc', /EXPAND, /ALL_FILES
       IDL> addpath, '+/hvc/robishaw/hvc', /ALL_FILES


 PROCEDURES CALLED:
       EXPAND_PATH
       ARRAY_EQUAL

 MODIFICATION HISTORY:
   Written Tim Robishaw, Berkeley  26 Jul 2001

(See /dzd2/heiles/idl/gen/path/addpath.pro)


DUPLIX -- FIND IDL FILES WITH THE SAME NAME IN YOUR IDL PATH.

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
DUPLIX -- find IDL files with the same name in your IDL path.

 PURPOSE:
       To find IDL files with the same name in your IDL path.

 CALLING SEQUENCE:
       DUPLIX [, string][, AVOID=string][, /MORE]

 INPUTS:
       FILEGREP : string (scalar); file names with containing this string
                  will be looked for

 KEYWORD PARAMETERS:
       AVOID = string (scalar or array); paths containing this string 
               will not be searched.
       /MORE : Set this keyword to list duplications in style of MORE.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       A list of duplicate IDL file names (with full paths) is
       printed to the screen.

 EXAMPLE:
       The following will look for all files with names matching
       'calc' and will avoid any path with 'homework' or 'goddard'
       in its name:

       IDL> duplix, 'calc', AVOID=['homework','goddard']

 NOTES:
       Tested for UNIX and Linux.

 MODIFICATION HISTORY:
   24 May 2003  Written by Tim Robishaw, Berkeley

(See /dzd2/heiles/idl/gen/path/duplix.pro)


GETPATH -- PRINT OUT THE CURRENT !PATH SYSTEM VARIABLE AS A LIST OF DIRECTORIES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
GETPATH -- print out the current !path system variable as a list of directories
     
 PURPOSE:
       To print out the current !path system variable as a list
       of directories, rather than a character-separated string.
     
 CALLING SEQUENCE:
       GETPATH [,/MORE]
     
 INPUTS:
       None.
     
 OUTPUTS:
       None.

 KEYWORDS:
       MORE : Set this keyword to list !PATH in style of MORE.

 COMMON BLOCKS:
       None.

 SIDE EFFECTS:
       The entire IDL path is printed to the screen.

 NOTES:
       Tested for UNIX and Linux.

 MODIFICATION HISTORY:
       Written Tim Robishaw, Berkeley 18 Feb 2002

(See /dzd2/heiles/idl/gen/path/getpath.pro)


WHICH

[Previous Routine] [List of Routines]
 NAME:
       WHICH

 PURPOSE: 
       To search for any file in the IDL !path that contains the
       user-supplied IDL routine (procedure or function) name.  Also
       returns compilation status of each routine (in IDL lingo,
       whether or not the routine is "resolved".)

 CALLING SEQUENCE:
       WHICH, file

 INPUTS:
       FILE - file name to search for.  The suffix .pro will be
              appended if not included.

 KEYWORD PARAMETERS:
       None.

 OUTPUTS:
       None.

 COMMON BLOCKS:
       None.

 RESTRICTIONS: 
       The IDL !path is searched for file names that are simply the
       module (in IDL documentation, "module" and "routine" are used
       interchangeably) name with a ".pro" suffix appended to them.
       A module stored inside a file whose name is different than the
       module name (followed by a ".pro") will not be found UNLESS
       that module happens to be the currently-resolved module!
       E.g., if the module "pro test_proc" lives in a file named
       "dumb_name.pro", then it will not be found:

       IDL> which, 'test_proc'
       Module TEST_PROC Not Compiled.
       % WHICH: test_proc.pro not found on IDL !path.

       unless it happens to be resolved:

       IDL> .run dumb_name
       % Compiled module: TEST_PROC.
       IDL> which, 'test_proc'
       Currently-Compiled Module TEST_PROC in File:
       /home/robishaw/dumb_name.pro

       However, this is terrible programming style and sooner or
       later, if you hide generically-named modules in
       inappropriately-named files, bad things will (deservedly)
       happen to you.

       The routine further assumes that a file named "dumb_name.pro"
       actually contains a module named "dumb_name"!  If it doesn't,
       then you are a bad programmer and should seek professional
       counseling.
 
 PROCEDURES CALLED:
       STRSPLIT(), WHICH_FIND_ROUTINE()

 EXAMPLES:
       You haven't yet resolved (compiled) the routine (module)
       DEFROI.  Let's look for it anyway:

         IDL> which, 'defroi
         Module DEFROI Not Compiled.

         Other Files Containing Module DEFROI in IDL !path:
         /usr/local/rsi/idl/lib/defroi.pro

       For some reason you have two modules with the same name.
       (This can occur in libraries of IDL routines such as the
       Goddard IDL Astronomy User's Library; an updated version of a
       routine is stored in a special directory while the old version
       is stored in its original directory.) Let's see which version
       of the module ADSTRING we are currently using:

         IDL> which, 'adstring.pro'
         Currently-Compiled Module ADSTRING in File:
         /home/robishaw/idl/goddard/pro/v5.4+/adstring.pro

         Other Files Containing Module ADSTRING in IDL !path:
         /home/robishaw/idl/goddard/pro/astro/adstring.pro

 NOTES:
       First, all currently-compiled procedures and functions are searched.
       Then the remainder of the IDL !path is searched.

 MODIFICATION HISTORY:
   30 May 2003  Written by Tim Robishaw, Berkeley
   17 Feb 2004  Fixed oddity where user tries to call a function as
                if it were a procedure, thus listing the module in both
                the Compiled Functions and Compiled Procedures list.

(See /dzd2/heiles/idl/gen/path/which.pro)