FileTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Input and Output : File Manipulation : FileTools : FileTools/CanonicalPath

FileTools

  

CanonicalPath

  

get canonical filepath

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

CanonicalPath(path, directory)

Parameters

path

-

string; filepath, relative or absolute

directory

-

(optional) string; directory to which relative paths refer

Description

• 

The CanonicalPath(path, directory) command returns an equivalent of the path which is an canonical path, that is, a filepath independent of the value of the current directory in which any symbolic links and the special directories . and .. have been resolved.

• 

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.

Examples

currentdir/Users/mapleuser:

FileToolsCanonicalPath../otheruser

/Users/otheruser

(1)

FileToolsCanonicalPathpasswd,/etc

/etc/passwd

(2)

The absolute path /home/maple is returned verbatim.

FileToolsCanonicalPath/home/maple

/home/maple

(3)

Compatibility

• 

The FileTools[CanonicalPath] command was introduced in Maple 2018.

• 

For more information on Maple 2018 changes, see Updates in Maple 2018.

See Also

FileTools

FileTools[AbsolutePath]

FileTools[Exists]

FileTools[IsDirectory]

FileTools[IsExecutable]

FileTools[IsLink]

FileTools[IsReadable]

FileTools[IsWritable]

FileTools[MakeDirectory]