Permalink
Browse files

uncompress-tlog supports both .tlf and .tlc

  • Loading branch information...
1 parent c255033 commit ccc998fd37412801051ae4357f858859bde7292f Romain Slootmaekers committed Feb 3, 2011
Showing with 20 additions and 5 deletions.
  1. BIN data/005.tlc
  2. +19 −4 src/main.ml
  3. +1 −1 src/tlog/tlc2.ml
View
Binary file not shown.
View
@@ -132,10 +132,25 @@ let compress_tlog tlu =
Unix.unlink tlu;
Lwt_main.run t;0
-let uncompress_tlog tlf =
- let tlu = Tlc2.to_tlog_name tlf in
- let t = Compression.uncompress_tlog tlf tlu in
- Unix.unlink tlf;
+let uncompress_tlog tlx =
+ let t =
+ let extension = Tlc2.extension_of tlx in
+ if extension = Tlc2.archive_extension then
+ begin
+ let tlu = Tlc2.to_tlog_name tlx in
+ Compression.uncompress_tlog tlx tlu >>= fun () ->
+ Unix.unlink tlx;
+ Lwt.return ()
+ end
+ else if extension = ".tlc" then
+ begin
+ let tlu = Tlc2.to_tlog_name tlx in
+ Tlc_compression.tlc2tlog tlx tlu >>= fun () ->
+ Unix.unlink tlx;
+ Lwt.return ()
+ end
+ else Lwt.fail (Failure "unknown file format")
+ in
Lwt_main.run t;0
let run_some_tests repeat_count filter =
View
@@ -46,7 +46,7 @@ let to_archive_name fn =
let to_tlog_name fn =
let length = String.length fn in
let extension = String.sub fn (length -4) 4 in
- if extension = archive_extension
+ if extension = archive_extension || extension = ".tlc"
then
let root = String.sub fn 0 (length -4) in
root ^ ".tlog"

0 comments on commit ccc998f

Please sign in to comment.