共用方式為


is_empty 函式

表示指定路徑是否參考空檔案或空的目錄。

template<class Path>
inline bool is_empty(
   const Path& Pval
);

參數

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

傳回值

如果 Pval 參考現有的目錄,則函式會傳回 basic_directory_iterator<Path>(Pval) == basic_directory_iterator<Path>()。

如果 Pval 參考現有檔案,則函式會傳回 file_size(Pval) == 0。

備註

如果 Pval 參考不存在的路徑,函式會擲回 basic_filesystem_error

需求

標題: 檔案系統

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

請參閱

參考

<filesystem>

exists 函式

basic_directory_iterator 類別

file_size 函式

其他資源

標頭檔