···2020 + [ ] File stats
2121- [ ] Server implementation
2222 + [x] Establishing connection
2323- + [ ] Tree walking
2323+ + [x] Tree walking
2424 + [ ] File/directory creation
2525 + [ ] File/directory deletion
2626- + [ ] File stats
2626+ + [x] File stats
2727 + [ ] Customisable FS implementations
28282929### Example FS
30303131-- [ ] "Passthrough" - which will simply allow accessing some "real" directory in
3131+- [-] UnixFs - which will simply allow accessing some "real" directory in
3232 system FS
3333+3434+ **WIP**: Implemented directory reading and file reading.
3335- [ ] ErlProcFS - which will expose Erlang process tree and other internal data
3436 via API similar to `procfs` from Linux
3537
+21-2
src/e9p.erl
···4455-module(e9p).
6677--export([make_qid/4]).
77+-export([make_qid/4, is_type/2]).
8899-export_type([qid/0, fid/0]).
1010···2727%-spec make_qid()
2828make_qid(Type, Version, Path, State) ->
2929 #{
3030- type => e9p_utils:to_qtype(Type),
3030+ type => to_qtype(Type),
3131 version => Version,
3232 path => Path,
3333 state => State
3434 }.
3535+3636+is_type(#{type := QType}, Type) ->
3737+ (to_qtype(Type) band QType) =/= 0.
3838+3939+to_qtype(List) when is_list(List) ->
4040+ lists:foldl(
4141+ fun(El, Acc) when is_integer(Acc) -> to_qtype(El) bor Acc end,
4242+ 0,
4343+ List
4444+ );
4545+4646+to_qtype(directory) -> 16#80;
4747+to_qtype(append) -> 16#40;
4848+to_qtype(excl) -> 16#20;
4949+to_qtype(device) -> 16#10;
5050+to_qtype(auth) -> 16#08;
5151+to_qtype(tmp) -> 16#04;
5252+to_qtype(symlink) -> 16#02;
5353+to_qtype(regular) -> 16#00.