MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / filetype

Method filetype

lib/host/wasi/inode-win.cpp:2141–2156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2139}
2140
2141WasiExpect<__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
2158bool INode::isDirectory() const noexcept {
2159 return getAttribute(Handle)

Callers

nothing calls this directly

Calls 4

fastGetFileTypeFunction · 0.85
getAttributeFunction · 0.85
getDiskFileTypeFunction · 0.85
getSocketTypeFunction · 0.85

Tested by

no test coverage detected