ocaml - End_of_file exception when creating TAR file with *ocaml_tar* -
when try create tar file using ocaml_tar library, end_of_file exception.
my code ...
#require "tar";; #require "tar.unix";; let f = unix.openfile "test.tar" [ unix.o_rdwr; unix.o_creat ] 0o600;; tar_unix.archive.create ["write_ex.ml"] f;; unix.close f;;
... produces following stacktrace:
$ utop write_ex.ml exception: end_of_file. raised @ file "lib/tar.ml", line 549, characters 36-47 called file "lib/tar.ml", line 460, characters 4-11 called file "stream.ml", line 149, characters 33-38 called file "lib/tar.ml", line 578, characters 6-28 called file "toplevel/toploop.ml", line 180, characters 17-56
does know what's wrong?
there nothing wrong code. bug in tar_unix
module. output
function wasn't robust enough , fails end_of_file
exception if write truncated. i've fixed issue , code works fine. see pr more information.
update
the pr merged , newer (0.5.1) version released opam. upgrade latest version with:
opam update opam upgrade
make sure, latest (>= 0.5.1) version installed, querying opam
opam show tar-format
if still old, force opam install latest one:
opam install 'tar-format>=0.5.1'
Comments
Post a Comment