Welcome to the Harris Geospatial documentation center. Here you will find reference guides and help documents.

  >  Docs Center  >  Libraries  >  Markwardt  >  NORMPATH






  Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
  UPDATED VERSIONs can be found on my WEB PAGE:


  Construct an absolute file/directory path from a relative path

Major Topics

  Files, I/O

Calling Sequence



  NORMPATH constructs a "normalized" filename or directory path from
  a specified relative path. The relative path may contain path
  components which move up and/or down the hierarchy of the file
  system. The returned path will be the most absolute path that can
  be specified.
  If the user specifies the CURRENT keyword, then relative paths are
  assumed to originate in the CURRENT directory. If CURRENT is not
  specified, then it is possible for the returned path to have
  path components relative to the current directory.
  NORMPATH should be platform independent. Note that the paths do
  not necessarily need to exist on the file system.


  FROM - scalar string, gives the relative path.
  NORMALIZED - upon return, the normalized form of FROM.


  CURRENT - if specified, must be a scalar string which gives the
            path to the current directory used in forming the
            normalized path. If not specified, then the returned
            path may have some relative components.


  NORMPATH, '/x/y/z', path & print, path
  The specified path is already normalized, so there is no action
  NORMPATH, '/x/y/../w/z', path & print, path
  The specified path had relative components which were removed.
  NORMPATH, '../x/y/../w/z', path & print, path
  The specified path had relative components which could not be
  NORMPATH, '../x/y/../w/z', path, current='/root' & print, path
  The absolute path of the current directory was given (and then the
  relative path moved outside of /root).

Modification History

  Written and documented, 12 Mar 2004 CM
  Usage message, 23 Mar 2008 CM
  Handle case of 'a//b', which should be 'a/b', 23 Mar 2008 CM
  $Id: normpath.pro,v 1.2 2008/03/23 18:15:14 craigm Exp $

© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us