| 43 | static constexpr uint8_t WASM_DT_LNK = 10; |
| 44 | |
| 45 | static uint8_t dt_from_entry(const fs::directory_entry& e) { |
| 46 | std::error_code ec; |
| 47 | if(e.is_symlink(ec)) return WASM_DT_LNK; |
| 48 | if(e.is_directory(ec)) return WASM_DT_DIR; |
| 49 | if(e.is_regular_file(ec)) return WASM_DT_REG; |
| 50 | return WASM_DT_UNKNOWN; |
| 51 | } |
| 52 | |
| 53 | // ---- Helper: write a struct stat into wasm memory -------------------------- |
| 54 |