A canonical path is unique and absolute. This methode converts first the path in an absolute form if necessary, na ruta canónica es absoluta y única. Este método convierte primero la ruta en forma absoluta de ser necesario, as if the methode was called getAbsolutePath(), and then map the path to its unique form depending on the system. Usually, this is performed removing redundant names as "." and ".." of the path, resolving simbolic links (in UNIX platforms) and converting the drive letters in standard nomenclature (in Microsoft Windows platforms).

Any path which references a file or an existing directory has a unique canocical form. Any path which references a file or a non-existing directory has also an unique canocical form.

1 file.getCanonicalPath

Returns the canonical path of a file.

<file.getCanonicalPath>
    <file /> !
</file.getCanonicalPath>
Example

Print on screen the canonical path of the file.

Copy
<xsql-script name='file_getCanonicalPath_sample1'>
    <body>
        <set name='m_path'>
            <string>c:<file.separator />jas<file.separator />webstudio.gc</string>
        </set>
        <println trim='true'>
            Canonical path of the file<string.space /><m_path/><string.space />:<string.space />
            <file.getCanonicalPath>
                <file name='#m_path' type='absolute' />
            </file.getCanonicalPath>
        </println>
    </body>
</xsql-script>