idlastro / Miscellaneous (Non-Astronomy) Procedures: BREAK_PATH

[Source code]

NAME
BREAK_PATH()
PURPOSE
Breaks up a path string into its component directories.
CALLING SEQUENCE
Result = BREAK_PATH( PATHS [ /NoCurrent])
INPUTS
PATHS   = A string containing one or more directory paths.  The
          individual paths are separated by commas, although in UNIX, 
          colons can also be used.  In other words, PATHS has the same 
          format as !PATH, except that commas can be used as a separator 
          regardless of operating system.
          A leading $ can be used in any path to signal that what follows 
          is an environmental variable, but the $ is not necessary.    
          Environmental variables can themselves contain multiple paths.
OUTPUT
The result of the function is a string array of directories.
Unless the NOCURRENT keyword is set, the first element of the array is 
always the null string, representing the current directory.  All the 
other directories will end in the correct separator character for the 
current operating system.
OPTIONAL INPUT KEYWORD
/NOCURRENT = If set, then the current directory (represented by
         the null string) will not automatically be prepended to the
         output.
PROCEDURE CALLS
None.
REVISION HISTORY
Version 1, William Thompson, GSFC, 6 May 1993.
        Added IDL for Windows compatibility.
Version 2, William Thompson, GSFC, 16 May 1995
        Added keyword NOCURRENT
Version 3, William Thompson, GSFC, 29 August 1995
        Modified to use OS_FAMILY
Version 4, Zarro, GSFC, 4 August 1997
        Added trim to input
Fix directory character on Macintosh system   A. Ferro   February 2000
Use STRSPLIT instead of STR_SEP()   W. Landsman    July 2002
Remove VMS support    W. Landsman   September 2006