function _9p_readdir(ctx, path) local f = ctx:newfid() local offset = 0 local dir, data = nil, nil ctx:walk(ctx.rootfid, f, path) ctx:open(f, ORDONLY) data = ctx:read(f, offset, READ_BUF_SIZ) if data == nil then print("DATA IS NIL") return end dir = tostring(data) --pprint(data) offset = offset + #data while (true) do data = ctx:read(f, offset, READ_BUF_SIZ) if (data == nil) then break end dir = dir .. tostring(data) offset = offset + #(tostring(data)) end ctx:clunk(f) return dir end