diff -a -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/lib/md4.ml ./src/utils/lib/md4.ml
--- ./src/utils/lib/md4.ml	2006-01-09 01:25:59.000000000 +0100
+++ ./src/utils/lib/md4.ml	2006-02-02 00:26:23.000000000 +0100
@@ -469,12 +469,10 @@
         "tiger_unsafe_string"
         
       let unsafe_file digest filename = 
-        Printf2.lprintf "Tiger.unsafe_file not implemented\n";
-        exit 70
+        failwith "Tiger.unsafe_file not implemented"
         
-      let digest_subfile digest fd pos len = 
-        Printf2.lprintf "Tiger.digest_subfile not implemented\n";
-        exit 70
+      let digest_subfile _ _ _ _ = 
+        failwith "Tiger.digest_subfile not implemented"
     
       module Base = Base32
         
diff -a -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/lib/stubs_c.c ./src/utils/lib/stubs_c.c
--- ./src/utils/lib/stubs_c.c	2006-01-26 01:25:25.000000000 +0100
+++ ./src/utils/lib/stubs_c.c	2006-02-02 00:27:33.000000000 +0100
@@ -587,11 +587,11 @@
 *******************************************************************/
 #include "tiger.h"
 
-static void tiger_tree_fd(OS_FD fd, size_t len, size_t pos, size_t block_size, char *digest)
+static void tiger_tree_fd(OS_FD fd, OFF_T len, OFF_T pos, OFF_T block_size, char *digest)
 {
   static char tiger_buffer[BLOCK_SIZE+1];
   if(block_size == BLOCK_SIZE){
-    size_t length = (len - pos > BLOCK_SIZE) ? BLOCK_SIZE : len - pos;
+    OFF_T length = (len - pos > BLOCK_SIZE) ? BLOCK_SIZE : len - pos;
     char *s = tiger_buffer+1;
     size_t toread = length;
     char *curs = s;
diff -a -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/lib/tiger.c ./src/utils/lib/tiger.c
--- ./src/utils/lib/tiger.c	2005-12-01 00:46:25.000000000 +0100
+++ ./src/utils/lib/tiger.c	2006-02-02 00:28:15.000000000 +0100
@@ -17,6 +17,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#include "../../utils/lib/os_stubs.h"
 #include "tiger.h"
 #include <caml/config.h>
 
@@ -775,7 +776,7 @@
 #define MAX_TIGER_CHUNK_SIZE 1024
 static word64 tiger_buffer[MAX_TIGER_CHUNK_SIZE];
 
-void tiger_hash(char prefix, char *s, long len, unsigned char *digest)
+void tiger_hash(char prefix, char *s, OFF_T len, unsigned char *digest)
 {
   char *buffer = (char*) tiger_buffer;
   word64 ndigest[3];
@@ -818,14 +819,13 @@
 
 #include "tiger.h"
 #include "md4.h"
-
 #include "caml/mlvalues.h"
 #include "caml/fail.h"
 #include "caml/alloc.h"
 
-unsigned long tiger_block_size(unsigned long len)
+OFF_T tiger_block_size(OFF_T len)
 {
-  unsigned long block_size = BLOCK_SIZE;
+  OFF_T block_size = BLOCK_SIZE;
   while(block_size < len) block_size *= 2;
   return block_size;
 }
diff -a -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./src/utils/lib/tiger.h ./src/utils/lib/tiger.h
--- ./src/utils/lib/tiger.h	2005-10-25 11:46:50.000000000 +0200
+++ ./src/utils/lib/tiger.h	2006-02-02 00:28:52.000000000 +0100
@@ -17,6 +17,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#include "../../utils/lib/os_stubs.h"
 #ifndef _TIGER_H
 #define _TIGER_H
 
@@ -30,6 +31,6 @@
 #define TREE_DEPTH 10
 
 
-void tiger_hash(char prefix, char *s, long len, unsigned char *digest);
-unsigned long tiger_block_size(unsigned long len);
+void tiger_hash(char prefix, char *s, OFF_T len, unsigned char *digest);
+OFF_T tiger_block_size(OFF_T len);
 #endif
diff -a -x CVS -x Root -x Repository -x Tag -x Entries -x Entries.Log -x .svn -x '*.rej' -x '*.orig' -x .cvsignore -N -r -u ./tools/mld_hash.ml ./tools/mld_hash.ml
--- ./tools/mld_hash.ml	2006-01-09 01:25:59.000000000 +0100
+++ ./tools/mld_hash.ml	2006-02-02 00:30:54.000000000 +0100
@@ -87,7 +87,9 @@
 (*************************************************************************)
 
 let bitprint_file fd file_size partial =
+  lprintf "Calculating SHA1\n";
   let sha1 = Sha1.digest_subfile fd zero file_size in
+  lprintf "Calculating TigerTree\n";
   let tiger = TigerTree.digest_subfile fd zero file_size in
   lprintf "urn:bitprint:%s.%s\n" (Sha1.to_string sha1) (TigerTree.to_string tiger);
   let file_size = Unix32.getsize64 fd in
@@ -100,7 +102,7 @@
       let end_pos = min end_pos file_size in
       let len = end_pos -- begin_pos in
       let tiger = TigerTree.digest_subfile fd begin_pos len in
-      if !partial then lprintf "  Partial %3d : %s\n" i (TigerTree.to_string tiger);
+      if !partial then lprintf "  Partial %4d/%4d : %s\n" i nchunks (TigerTree.to_string tiger);
       chunks.(i) <- tiger
     done;
     chunks
@@ -140,7 +142,7 @@
       let end_pos = min end_pos file_size in
       let len = end_pos -- begin_pos in
       let md4 = Md4.digest_subfile fd begin_pos len in
-      if !partial then lprintf "  Partial %3d : %s\n" i (Md4.to_string md4);
+      if !partial then lprintf "  Partial %4d/%4d : %s\n" i nchunks (Md4.to_string md4);
       let md4 = Md4.direct_to_string md4 in
       String.blit md4 0 chunks (i*16) 16;
     done;
@@ -164,7 +166,7 @@
     let end_pos = min end_pos file_size in
     let len = end_pos -- begin_pos in
     let md4 = Sha1.digest_subfile fd begin_pos len in
-    lprintf "  Partial %3d (%Ld-%Ld) : %s\n" i begin_pos end_pos
+    lprintf "  Partial %4d/%4d (%Ld-%Ld) : %s\n" i nchunks begin_pos end_pos
       (Sha1.to_string md4);
   done
 
@@ -175,6 +177,7 @@
 (*************************************************************************)
   
 let ed2k_hash_filename filename partial = 
+  lprintf "Calculating ed2k of %s\n" filename;
   let fd = Unix32.create_ro filename in
   let file_size = Unix32.getsize64 fd in
   let md4 = ed2k_hash_file fd file_size partial in
@@ -190,6 +193,7 @@
 (*************************************************************************)
   
 let sig2dat_hash_filename filename partial =
+  lprintf "Calculating sig2dat of %s\n" filename;
   let fd = Unix32.create_ro filename in
   let file_size = Unix32.getsize64 fd in
   let len64 = min 307200L file_size in
@@ -198,7 +202,7 @@
   Unix32.read fd zero s 0 len;
   let md5ext = Md5Ext.string s in
   lprintf "sig2dat://|File: %s|Length: %Ld Bytes|UUHash: %s|/\n"
-    filename file_size (Md5Ext.to_string md5ext);
+    (Url.encode (Filename.basename filename)) file_size (Md5Ext.to_string md5ext);
   lprintf "    Hash: %s\n" (Md5Ext.to_hexa_case false md5ext);
   ()
 
@@ -210,14 +214,6 @@
   
 let check_external_functions size = 
   let partial = ref true in
-  let nchunks = 1024 in
-(*
-  let chunk_sizes = [
-      10 (* 10 KB *); 1000 (* ~ 1 MB *) ; 
-(*      50000 (* ~ 50 MB *) ;   *)
-(*      100000 (* ~ 100 MB *); 3000000 (* ~ 3 GB *)  *)
-    ]
-  in *)
   let test_string_len = 43676 in
   let dummy_string = "bonjourhello1" in
   
@@ -283,11 +279,6 @@
       waves
   in
   let waves = iter zero [] in
-  
-  lprintf "Waves: \n";
-  List.iter (fun (pos,len) ->
-      lprintf " %Ld[%d]," pos len;
-  ) waves;
   lprintf "\n";
   List.iter (fun (name,f,f') ->
       let filename = Printf.sprintf "test.%s.%d" name size in
@@ -321,14 +312,16 @@
         let (sha1, tiger2) = bitprint_file file file_size partial in
         lprintf "urn:bitprint:%s.%s\n" (Sha1.to_string sha1) (TigerTree.to_string tiger2);
         
+(*
         lprintf (_b "Renaming...\n");
-        Unix32.rename file (filename ^ ".final");            
-        
+        Unix32.rename file (filename ^ ".final");
+
         lprintf (_b "Removing %s\n") filename;
         Unix32.remove file;
-        
         let file = f' (filename ^ ".final") file_size in
         Unix32.remove file;
+*)
+        Unix32.remove file;
         
         lprintf "done\n"
       with e ->
@@ -410,11 +403,19 @@
   
 let _ =
 (*  set_strings_file "mlnet_strings"; *)
+  MlUnix.set_signal  Sys.sigint
+    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGINT, stopping mld_hash...";
+        exit 0));
+
+  MlUnix.set_signal  Sys.sigterm
+    (Sys.Signal_handle (fun _ -> lprintf_nl "Received SIGTERM, stopping mld_hash...";
+        exit 0));
+
   let partial = ref false in
   Arg2.parse2 [
     "-diff_chunk", Arg2.Array (4, diff_chunk), 
     "<filename1> <filename2> <begin_pos> <end_pos> : compute diff between the two files";
-    "-hash", Arg2.String ( (:=) hash), _s " <hash> : Set hash type you want to compute (ed2k, sig2dat,bp)";
+    "-hash", Arg2.String ( (:=) hash), _s " <hash> : Set hash type you want to compute (ed2k, sig2dat, bp)";
     "-sha1", Arg2.String (fun size ->
         hash := "sha1";
         chunk_size := Int64.of_string size;
