共用方式為


exists 函式

指定檔案是否存在。

inline bool exists(
   file_status Stat
);
template<class Path>
inline bool exists(
   const Path& Pval
);

參數

  • Stat
    file_status 物件。

  • Pval
    Path 物件。 Path 可以是 basic_path 或從 basic_path衍生型別。

傳回值

第一個函式傳回 status_known(Stat) && Stat.type() != file_not_found。

第二個函式傳回 exists(status(Pval))。

備註

如果基礎 file_type 知道, file_status 代表現有檔案

需求

標題: 檔案系統

命名空間: std::tr2::sys

請參閱

參考

<filesystem>

status_known 函式

status 函式

file_type 列舉型別

其他資源

標頭檔