##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::filesystem::hard_link_count

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

Defined in header `<experimental/filesystem>` |  |
uintmax_t hard_link_count( const path& p ); | (1) | (filesystem TS)
uintmax_t hard_link_count( const path& p, error_code& ec ); | (2) | (filesystem TS)

Returns the number of hard links for the file identified by path `p`.

The second version returns `-1` and sets `ec` to an appropriate error code if an error occurs. Otherwise, `ec` is cleared using ec.clear().

### [edit] Parameters

p | - | path to return the hard link count for

### [edit] Return value

The number of hard links for `p`.

### [edit] Exceptions

1) filesystem_error if an error occurs. The exception object is constructed with `p` as an argument.
2)
`noexcept` specification:
noexcept

### [edit] See also

| This section is incomplete

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

- unconditionally noexcept
- Todo without reason