在线文档教程
C++
文件系统 | Filesystem

std::filesystem::is_other

STD::文件系统::is[医]其他

Defined in header
bool is_other( std::filesystem::file_status s (1)(since C++17)
bool is_other( const std::filesystem::path& p bool is_other( const std::filesystem::path& p, std::error_code& ec (2)(since C++17)

检查给定的文件状态或路径是否与类型文件相对应。其他类型。也就是说,该文件存在,但既不是常规文件,也不是目录,也不是符号链接。

1%29相当于exists(s) && !is_regular_file(s) && !is_directory(s) && !is_symlink(s)...

2%29相当于is_other(status(p))is_other(status(p, ec))分别。

参数

s-file status to check
p-path to examine
ec-error code to store the error status to

返回值

true如果由p或者如果所指示的类型s引用非常规文件、目录或符号链接的文件,false否则。非抛出重载返回。false如果发生错误。

例外

1%29

noexcept规格:

noexcept

2%29不占用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)
file_status (C++17)represents file type and permissions (class)
status_known (C++17)checks whether file status is known (function)
is_block_file (C++17)checks whether the given path refers to block device (function)
is_character_file (C++17)checks whether the given path refers to a character device (function)
is_directory (C++17)checks whether the given path refers to a directory (function)
is_fifo (C++17)checks whether the given path refers to a named pipe (function)
is_regular_file (C++17)checks whether the argument refers to a regular file (function)
is_socket (C++17)checks whether the argument refers to a named IPC socket (function)
is_symlink (C++17)checks whether the argument refers to a symbolic link (function)
exists (C++17)checks whether path refers to existing file system object (function)
statussymlink_statusstatus of the file designated by this directory entrysymlink_status of the file designated by this directory entry (public member function of std::filesystem::directory_entry)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/file system/is[医]其他