mode is a Mode.numeric
There is no good way to get the file type, normally you would AND with S_IFMT and test for equality with all the S_* types.
Testing the bits with Mode.test is not enough since the bits are shared between different file types.
Currently the only way I found to figure the filetype was doing:
let mode = (Obj.magic lst.mode : int) in
And then doing all the mask and comparison myself, see ocaml-multicore/eio#339