名稱空間
變體
操作

std::filesystem::directory_entry::hard_link_count

來自 cppreference.com
 
 
 
 
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) 在底層作業系統 API 錯誤時丟擲 std::filesystem::filesystem_error,構造時以 p 作為第一個路徑引數,以作業系統錯誤碼作為錯誤碼引數。
2) 如果作業系統 API 呼叫失敗,將 std::error_code& 引數設定為作業系統 API 錯誤碼;如果沒有發生錯誤,則執行 ec.clear()

[編輯] 示例

[編輯] 參閱

返回引用特定檔案的硬連結數量
(函式) [編輯]