FileTools
AbsolutePath
get absolute filepath
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
AbsolutePath(path, directory, opts)
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.
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.
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].
FileToolsAbsolutePath⁡passwd,/etc
/etc/passwd
The absolute path /home/maple is returned verbatim.
FileToolsAbsolutePath⁡/home/maple
/home/maple
The normalize option was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
The FileTools[AbsolutePath] command was updated in Maple 2020.
The base option was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
See Also
FileTools[CanonicalPath]
FileTools[Exists]
FileTools[IsDirectory]
FileTools[IsExecutable]
FileTools[IsReadable]
FileTools[IsWritable]
FileTools[MakeDirectory]
Download Help Document