std::filesy...d_link_count(3)
π std::filesy...d_link_count(3) π
okay so bestie, this is the C++ Standard Libary manual page for std::filesystem::directory_entry::hard_link_count. It is lowkey a tiny little filesystem detective for hard links. β¨
πΈ NAME πΈ
std::filesystem::directory_entry::hard_link_count-std::filesystem::directory_entry::hard_link_count
β¨ Synopsis β¨
std::uintmax_t hard_link_count() const;
(1) (since C++17)
std::uintmax_t hard_link_count( std::error_code& ec ) const
(2) (since C++17)
noexcept;
Those are the two overloads, both (since C++17). Slay. π
If the number of hard links is cached in this directory_entry, returns the cached value. Otherwise, returns:
std::filesystem::hard_link_count(path()),std::filesystem::hard_link_count(path(), ec).
π Parameters π
ecβ out-parameter for error reporting in the non-throwing overload.
π¦ Return value π¦
The number of hard links for the referred-to filesystem object. That's it. That's the whole vibe. π
π₯ Exceptions π₯
Any overload not marked noexcept may throw std::bad_alloc if memory allocation fails. π
- Throws
std::filesystem::filesystem_erroron underlying OS API errors, constructed withpas the first path argument and the OS error code as the error code argument. - Sets a
std::error_code¶meter to the OS API error code if an OS API call fails, and executesec.clear()if no errors occur.
π Example π
This section is incomplete Reason: no example
Bestie, there is literally no example here. The manual page said so, not me. π
β See also β
hard_link_countreturns the number of hard links referring to the specific file (C++17) (function)
π Category π
* Todo no example
π That's the page, bestie. Source: http://cppreference.com, date/version vibe: 2024.06.10, page: std::filesy...d_link_count(3). π«Ά
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms