std::filesystem::directory_entry::hard_link_count
提供: cppreference.com
< cpp | filesystem | directory entry
std::uintmax_t hard_link_count()const; std::uintmax_t hard_link_count(std::error_code& ec )constnoexcept; | (C++17以上) | |
この directory_entry
にハードリンクの数がキャッシュされていれば、そのキャッシュされている値を返します。 そうでなければ、それぞれ std::filesystem::hard_link_count(path()) または std::filesystem::hard_link_count(path(), ec) を返します。
目次 |
[編集]引数
ec | - | 例外を投げないオーバーロードでエラーを報告するための出力引数 |
[編集]戻り値
参照先のファイルシステムオブジェクトに対するハードリンクの数。
[編集]例外
std::error_code& 引数を取らないオーバーロードは、ベースとなる OS の API でエラーが発生した場合、第1パス引数に p
、エラーコード引数に OS のエラーコードを指定して構築された filesystem_error を投げます。 std::error_code& 引数を取るオーバーロードは、 OS の API 呼び出しが失敗した場合、その引数を OS の API のエラーコードに設定し、エラーが発生しない場合は ec.clear() を実行します。 noexcept
指定のないあらゆるオーバーロードは、メモリ確保に失敗した場合 std::bad_alloc を投げる可能性があります。
[編集]例
This section is incomplete Reason: no example |
[編集]関連項目
(C++17) | 指定されたファイルを参照しているハードリンクの数を返します (関数) |