##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::filesystem::canonical

From cppreference.com
< cpp‎ | experimental‎ | fs

Defined in header `<experimental/filesystem>` |  |
path canonical( const path& p, const path& base = current_path() ); | (1) | (filesystem TS)
path canonical( const path& p, error_code& ec ); | (2) | (filesystem TS)
path canonical( const path& p, const path& base, error_code& ec ); | (3) | (filesystem TS)

Converts path `p` to a canonical absolute path, i.e. one that has no dot, dot-dot elements or symbolic links. `p` is optionally relative to `base`.

`p` must resolve to an existing file, otherwise error occurs.

The return path resolves to the same path as absolute(p, base (or absolute(p) for (2)}}.

| This section is incomplete Reason: errors

### [edit] Parameters

| This section is incomplete

ec | - | error code to store error status to

### [edit] Return value

The canonical absolute path of `p`, which is optionally relative to `base`.

### [edit] Exceptions

| This section is incomplete

### [edit] See also

| This section is incomplete

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/fs/canonical&oldid=68481"
Categories:

- Todo with reason
- Todo without reason