| 2139 | } |
| 2140 | |
| 2141 | WasiExpect<__wasi_filetype_t> INode::filetype() const noexcept { |
| 2142 | switch (fastGetFileType(Type, Handle)) { |
| 2143 | case FILE_TYPE_DISK_: |
| 2144 | return getAttribute(Handle).map( |
| 2145 | [](auto Attr) { return getDiskFileType(Attr); }); |
| 2146 | case FILE_TYPE_CHAR_: |
| 2147 | return __WASI_FILETYPE_CHARACTER_DEVICE; |
| 2148 | case FILE_TYPE_PIPE_: |
| 2149 | if (Type == HandleType::NormalSocket) { |
| 2150 | return getSocketType(Socket); |
| 2151 | } else { |
| 2152 | return __WASI_FILETYPE_CHARACTER_DEVICE; |
| 2153 | } |
| 2154 | } |
| 2155 | return __WASI_FILETYPE_UNKNOWN; |
| 2156 | } |
| 2157 | |
| 2158 | bool INode::isDirectory() const noexcept { |
| 2159 | return getAttribute(Handle) |
nothing calls this directly
no test coverage detected