From 90ab7f046d2ca83ada0baba4841039dacc8f1262 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Niemier?= <~@hauleth.dev> Date: Mon, 26 Jan 2026 22:29:11 +0100 Subject: [PATCH] Define `stat/0` type --- src/e9p.erl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/e9p.erl b/src/e9p.erl index 4867075..1ecba9c 100644 --- a/src/e9p.erl +++ b/src/e9p.erl @@ -6,7 +6,7 @@ -export([make_qid/3, is_type/2]). --export_type([qid/0, fid/0]). +-export_type([qid/0, fid/0, stat/0]). -export_type([u8/0, u16/0, u32/0, u64/0]). @@ -21,6 +21,27 @@ -type fid() :: 16#00000000..16#FFFFFFFF. +-type filename() :: unicode:unicode_binary(). +-type path() :: [filename()]. + +-type stat() :: #{ + type := u16(), + dev := u32(), + qid => qid(), + mode => u32(), + atime := u32() | calendar:datetime(), + mtime := u32() | calendar:datetime(), + length := u64(), + name => unicode:chardata(), + uid := unicode:chardata(), + gid := unicode:chardata(), + muid := unicode:chardata(), + extra := unicode:chardata(), + n_uid := u32(), + n_gid := u32(), + n_muid := u32() +}. + %-spec make_qid() make_qid(Type, Version, Path) -> #qid{type = to_qtype(Type), version = Version, path = Path}. -- 2.51.2