命名空间
变体
操作

std::filesystem::directory_entry::hard_link_count

来自 cppreference.cn
 
 
 
 
std::uintmax_t hard_link_count() const;
(1) (自 C++17)
std::uintmax_t hard_link_count( std::error_code& ec ) const noexcept;
(2) (自 C++17)

如果硬链接数被缓存于此 directory_entry 中,则返回缓存值。否则,返回

内容

[编辑] 参数

ec - 非抛出重载中的错误报告输出参数

[编辑] 返回值

所指文件系统对象的硬链接数。

[编辑] 异常

任何未标记为 noexcept 的重载都可能在内存分配失败时抛出 std::bad_alloc

1) 在底层 OS API 错误时抛出 std::filesystem::filesystem_error,以 p 作为首个路径实参,OS 错误码作为错误码实参构造。
2) 若 OS API 调用失败,则将 std::error_code& 形参设为 OS API 错误码,且若无错误发生则执行 ec.clear()

[编辑] 示例

[编辑] 参见

返回指向特定文件的硬链接数
(函数) [编辑]