AbsolutePath - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


FileTools

  

AbsolutePath

  

get absolute filepath

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

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

FileToolsAbsolutePathpasswd,/etc

/etc/passwd

(1)

The absolute path /home/maple is returned verbatim.

FileToolsAbsolutePath/home/maple

/home/maple

(2)

Compatibility

• 

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

FileTools[CanonicalPath]

FileTools[Exists]

FileTools[IsDirectory]

FileTools[IsExecutable]

FileTools[IsReadable]

FileTools[IsWritable]

FileTools[MakeDirectory]