-
Notifications
You must be signed in to change notification settings - Fork 34
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
New tar gz #146
Merged
Merged
New tar gz #146
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
6c54ca0
revise a decoder and encoder, being pure
hannesm c67f945
remove stuff
hannesm 9ccc73b
wip
hannesm ebabd3c
fix
hannesm ce9337b
proposed API
hannesm 50f6659
add filter
hannesm 1b4ae55
initial compiling tar_unix
hannesm 984ffe0
remove offset nonsense
hannesm 9c1c120
lwt-unix
hannesm 29d884e
further work, get tests a bit more up to speed
hannesm 281883b
more tests are working now
hannesm 60d6faa
revive transform test
hannesm 462063b
test tar_unix, use fold for list
hannesm 2b49b1f
document write_header
hannesm 2388f62
Purify fold and move it into Tar with a GADT, use it then for Tar_gz …
dinosaure 8b308a9
Keep the bind as is and Tar_gz does not require the run function (/cc…
dinosaure 14681fe
Implement Tar_gz.gzipped : _ Tar.t -> _ Tar.t
reynir d5ad1df
Fix the otar binary
dinosaure c7c81d2
Implement the high kind polymorphism to fix the lwt_unix layer
dinosaure 906d6dc
Add a comment to explain the hkp trick
dinosaure b8b4ff6
Minor: qualify opens, fix tests
reynir 0cfd771
Partially implement tar_eio, stub out remainder
reynir c24cd1b
Seek returns unit, improve documentation
robur-team 576dcff
Remove [`Msg of string] from Tar_unix.decode_error
robur-team b1c10d0
Document Tar.fold
reynir 890c1fe
Fixups
reynir 6f4a26b
Add a way to produce a *.tar.gz archive from the new pure API
dinosaure 9a4ee14
Apply suggestions from @reynir
dinosaure 9684d77
Fix Tar.out
reynir 69f5301
Don't use Seq to keep compatibility with older version of OCaml
dinosaure 89a5f49
Upgrade the eio package
dinosaure 724aa17
Delete useless assert false in tar_gz.ml implementation
dinosaure da4b1eb
Also update the dune-project which generes opam files
dinosaure 4215ff0
Fix the Tar_gz implementation
dinosaure File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,16 +196,31 @@ type ('a, 'err, 't) t = | |
| Bind : ('a, 'err, 't) t * ('a -> ('b, 'err, 't) t) -> ('b, 'err, 't) t | ||
| Return : ('a, 'err) result -> ('a, 'err, 't) t | ||
| High : (('a, 'err) result, 't) io -> ('a, 'err, 't) t | ||
| Write : string -> (unit, 'err, 't) t | ||
|
||
val really_read : int -> (string, _, _) t | ||
val read : int -> (string, _, _) t | ||
val seek : int -> (unit, _, _) t | ||
val ( let* ) : ('a, 'err, 't) t -> ('a -> ('b, 'err, 't) t) -> ('b, 'err, 't) t | ||
val return : ('a, 'err) result -> ('a, 'err, _) t | ||
val write : string -> (unit, _, _) t | ||
|
||
type ('a, 'err, 't) fold = (?global:Header.Extended.t -> Header.t -> 'a -> ('a, 'err, 't) t) -> 'a -> ('a, 'err, 't) t | ||
|
||
val fold : ('a, [> `Fatal of error ], 't) fold | ||
(** [fold f] is a [_ t] that reads an archive and executes [f] on each header. | ||
[f] is expected to either read or skip the file contents, or return an | ||
error. *) | ||
|
||
type ('err, 't) content = unit -> (string option, 'err, 't) t | ||
type ('err, 't) entry = Header.compatibility option * Header.t * ('err, 't) content | ||
type ('err, 't) entries = unit -> (('err, 't) entry option, 'err, 't) t | ||
|
||
val out : | ||
?level:Header.compatibility | ||
-> Header.t | ||
-> ([> `Msg of string ] as 'err, 't) entries | ||
-> (unit, 'err, 't) t | ||
(** [out hdr entries] is a [_ t] that writes [entries] into an archive. [hdr] is | ||
the global header and each entry must come from a {!type:content} stream and | ||
the associated header.*) | ||
Comment on lines
+224
to
+226
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe add that it is the responsibility of the caller to ensure the file size of the header corresponds to the content. I also wonder if this interface makes it difficult to recover from an error. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think
Unix.read
raisesEnd_of_file
(but it doesn't hurt to catch...)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.
You are right, the
End_of_file
comes fromStdlib.input
. Feel free to delete it.