Product Site

8.51. SysSearchPath

Returns the absolute path of filename if it can be found along any of the paths specified in environment variable path. Returns the null string otherwise.

Parameters
path

An environment variable name. The environment variable must contain a list of paths, like in PATH.
filename

The name of the file to be searched. The name can optionally include a relative or an absolute path, but the name part must be a file, not a directory. If the name specified with an absolute path, it is returned without searching along the environment variable's paths. The name does not support wildcard characters. On Unix-like systems, if the first character is a ~ (tilde) character optionally followed by a username, it is replaced by the current or specified user's home directory.
option

Specifies where the search starts.
C

Starts the search at the current directory and then along the specified path. This is the default.
N

Only searches along path.

See also File method searchPath (Class Method).
Example 8.37. RexxUtil — SysSearchPath
say SysSearchPath("PATH", "rexx")      -- (Unix e.g.) /usr/local/bin/rexx
say SysSearchPath("PATH", "rexx.exe")  -- (Windows e.g.) C:\Program Files\ooRexx\rexx.exe