-
Notifications
You must be signed in to change notification settings - Fork 20
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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?
(* NOTE the return value is the number of bytes read; this is not completely obvious from | ||
the code *) |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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. |
There was a problem hiding this comment.
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. *) |
There was a problem hiding this comment.
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
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? *) |
There was a problem hiding this comment.
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
No description provided.