Back to library index.

Package pathfun (in pathfun.i) -

Index of documented functions or symbols:

add_y_home

DOCUMENT add_y_home, y_home, y_site;
      or add_y_home, y_both;

  Set all Yorick paths to take into account y_home as a new (additional)
  root for architecture-dependent files and y_site as the corresponding
  root for architecture-independent files.  Note that separating
  architecture-independent and architecture-dependent files is a
  deprecated practice.  If you work on two architectures, maintain two
  copies of y_home and y_site and keep your sanity.

  The paths taken care of are:
    - the main path for .i files (see set_path(), get_path();
    - the plug_dir path for compiled add-ons (see plug_dir());
    - GISTPATH (.gp and .gs files).
    
  In addition, we perform an include_all (which see) on y_home/i-start and
  y_site/i-start (unless we are not in batch mode and y_home or y_site is
  "~/yorick" or "~/Yorick", in which case this is done by i0/stdx.i).

  "add_y_home, y_both" is the same as setting y_site=y_home.
  
  See pkg_mngr.i for more.

basename

DOCUMENT file = basename(pathname)
  returns the file part of PATHNAME (like GNU basename), which
  can be an array of names

  Examples:
    pathname         basename(pathname)
    /                /
    /path/to/file    file
    /path/to/dir/    dir
    path/to/file     file
    file             file
    c:               c:
    c:/              c:

SEE ALSO: dirname

dirname

DOCUMENT dir = dirname(pathname)
  returns the directory part of PATHNAME (like GNU dirname), which
  can be an array of names

  Examples:
    pathname         dirname(pathname)
    /                /
    /path/to/file    /path/to
    /path/to/dir/    /path/to
    path/to/file     path/to
    file             .
    c:               c:
    c:/              c:

SEE ALSO: basename

find_in_path

DOCUMENT find_in_path(filename,takefirst=,path=)
  returns the full path (including filename) where filename has been found.

  Rules:
   - If filename has not been found, [] is returned
   - if filename has been found at several locations, a string vector
     with all locations is returned (unless takefirst is set, see below)

  If takefirst=1, will return when the first occurence of filename is
   found (returns a string scalar).
  If path= is set, it will be used instead of the default yorick path as
   returned by get_path(). Note that path must use the same syntax as
   the result of get_path(), i.e. a single string with ":" delimiters
   between the directories (and entries MUST end with a "/"), e.g.:
   path="/usr/local/share/yao/:/home/frigaut/Yorick/"
  

SEE ALSO: get_path, dirname, basename

pathform

DOCUMENT path = pathform(list)
  combine a LIST (that is, an array) of strings into a single colon
  delimited path.  For example,
    pathform(["one","two","three"]) --> "one:two:three"
  The delim= keyword can be used to specify an alternative separator
  for the components of the path, delim=":" is the default.

SEE ALSO: pathsplit, set_path, get_path, plug_dir

pathsplit

DOCUMENT list = pathsplit(path)
  split a colon delimited PATH into a list of strings.  For example,
    pathsplit("one:two:three") --> ["one","two","three"]
  The delim= keyword can be used to specify an alternative separator
  for the components of the path, delim=":" is the default.

SEE ALSO: pathform, set_path, get_path, plug_dir