std::filesystem::is_empty
| Defined in header <filesystem> |  |  | 
|---|---|---|
| bool is_empty( const std::filesystem::path& p ); bool is_empty( const std::filesystem::path& p, std::error_code& ec ); |  | (since C++17) | 
检查给定路径是否引用空文件或目录。
参数
| p | - | path to examine | 
|---|---|---|
| ec | - | error code to modify in case of error | 
返回值
true如果由p或者如果所指示的类型s引用空文件或目录,false否则。非抛出重载返回。false如果发生错误。
例外
不占用std::error_code&参数抛文件系统[医]误差关于基础OS API错误,使用p作为第一个参数和操作系统错误代码作为错误代码参数。std::bad_alloc如果内存分配失败,则可能引发。过载std::error_code&参数,如果OSAPI调用失败,则将其设置为OSAPI错误代码,并执行ec.clear()如果没有错误发生。这个过载
noexcept规格:
noexcept
例
另见
| statussymlink_status (C++17)(C++17) | determines file attributesdetermines file attributes, checking the symlink target (function) | 
|---|---|
| exists (C++17) | checks whether path refers to existing file system object (function) | 
 © cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

