AbsolutePath - Maple Help

FileTools

 AbsolutePath
 get absolute filepath

 Calling Sequence AbsolutePath(path, directory, opts)

Parameters

 path - string; filepath, relative or absolute directory - (optional) string; directory to which relative paths refer opts - (optional) argument of the form option or option=value where option is one of base or normalize.

Options

 • base=one of bindir, datadir, homedir, mapledir, tempdir, toolboxdir, worksheetdir.
 The base option specifies a base directory. If specified, the parameter dir is interpreted as a relative path under this directory. For the meaning of worksheetdir see interface; for any other of these symbols, see kernelopts.
 • normalize=truefalse
 Specifies whether AbsolutePath should attempt to produce a normalized path by removing . from path. The default is false.

Description

 • The AbsolutePath(path, directory) command returns an equivalent of the path which is an absolute path, that is, independent of the value of the current directory.  If path is already absolute, then path is returned.
 • The optional argument directory specifies the directory to which path refers, if it is relative.  Its default value is the current directory as provided by the currentdir command.  The argument directory must itself be an absolute path.
 Note: By default, AbsolutePath does not remove the special directory . from path. This may be achieved by including the optional parameter normalize. To remove both . and .. and resolve symbolic links, use FileTools[CanonicalPath].

Examples

 > $\mathrm{FileTools}\left[\mathrm{AbsolutePath}\right]\left("passwd","/etc"\right)$
 ${"/etc/passwd"}$ (1)

The absolute path /home/maple is returned verbatim.

 > $\mathrm{FileTools}\left[\mathrm{AbsolutePath}\right]\left("/home/maple"\right)$
 ${"/home/maple"}$ (2)

Compatibility

 • The normalize option was introduced in Maple 2018.