Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for src/unix/raw.mli #380

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tomjridge
Copy link
Contributor

No description provided.

Copy link

@Ngoguey42 Ngoguey42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for documenting all this :-)

Can you pass ocamlformat so that we can make that PR mergeable?

Comment on lines +21 to +22
(* NOTE the return value is the number of bytes read; this is not completely obvious from
the code *)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The returned value is the new offset, after the values read

Comment on lines +15 to +16
the file data (see irmin-pack's [Version] module - were the way to encode objects was
changed from [`V1] to [`V2]; [Version.set t s] will use exactly the first 8 bytes of the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the file data (see irmin-pack's [Version] module - were the way to encode objects was
changed from [`V1] to [`V2]; [Version.set t s] will use exactly the first 8 bytes of the
the file data (see irmin-pack's [Version] module - where the way to encode objects was
changed from [`V1] to [`V2]); [Version.set t s] will use exactly the first 8 bytes of the

Comment on lines +27 to +30
How does the user know where the header ends and the file data begins? One option is to
call {!fstat} after initializing the header info. In fact, in {!Index_unix} there is a
separate computation of the header size: [let header = eight ++ eight ++ eight ++ eight ++
fan_size]; presumably other users of this module do the same.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(** An exception that can be raised when {b reading} (not writing!) header fields, in case
the amount of bytes requested for a field is not the amount of bytes actually read
from file. This presumably happens only for files that are not initialized correctly,
i.e., they do not contain a full header. *)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can happen in several other situations

Suggested change
i.e., they do not contain a full header. *)
e.g., they do not contain a full header. *)

the amount of bytes requested for a field is not the amount of bytes actually read
from file. This presumably happens only for files that are not initialized correctly,
i.e., they do not contain a full header. *)
(* FIXME rename this exception? *)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that documenting it is enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants