Skip to content

Instantly share code, notes, and snippets.

@droyo
Last active June 8, 2020 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save droyo/be3fd25ac552c33cc1463ee132001367 to your computer and use it in GitHub Desktop.
Save droyo/be3fd25ac552c33cc1463ee132001367 to your computer and use it in GitHub Desktop.
let decode = Angstrom.(
advance 2 >>= fun () -> (* skip length prefix *)
LE.any_uint16 >>= fun s_type ->
LE.any_int32 >>= fun s_dev ->
Qid.decode >>= fun s_qid ->
LE.any_int32 >>= fun s_mode ->
LE.any_int32 >>= fun s_atime ->
LE.any_int32 >>= fun s_mtime ->
LE.any_int64 >>= fun s_length ->
decode_string >>= fun s_name ->
decode_string >>= fun s_uid ->
decode_string >>= fun s_gid ->
decode_string >>= fun s_muid ->
return { s_type; s_dev; s_qid; s_mode; s_atime
; s_mtime; s_length; s_name; s_uid; s_gid; s_muid })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment