150 |
let ni n m = |
let ni n m = |
151 |
let s = Printf.sprintf "File.%s not implemented by %s" |
let s = Printf.sprintf "File.%s not implemented by %s" |
152 |
m n.network_name in |
m n.network_name in |
153 |
lprintf "%s\n" s; |
lprintf_nl "%s" s; |
154 |
s |
s |
155 |
|
|
156 |
let fni n m = failwith (ni n m) |
let fni n m = failwith (ni n m) |
741 |
f |
f |
742 |
|
|
743 |
let check_file_implementations () = |
let check_file_implementations () = |
744 |
lprintf "\n---- Methods not implemented for CommonFile ----\n"; |
lprintf_nl "\n---- Methods not implemented for CommonFile ----\n"; |
745 |
List.iter (fun (c, cc) -> |
List.iter (fun (c, cc) -> |
746 |
let n = c.op_file_network.network_name in |
let n = c.op_file_network.network_name in |
747 |
lprintf "\n Network %s\n" n; |
lprintf_nl "\n Network %s" n; |
748 |
if c.op_file_to_option == cc.op_file_to_option then |
if c.op_file_to_option == cc.op_file_to_option then |
749 |
lprintf "op_file_to_option\n"; |
lprintf_nl "op_file_to_option"; |
750 |
if c.op_file_info == cc.op_file_info then |
if c.op_file_info == cc.op_file_info then |
751 |
lprintf "op_file_info\n"; |
lprintf_nl "op_file_info"; |
752 |
if c.op_file_commit == cc.op_file_commit then |
if c.op_file_commit == cc.op_file_commit then |
753 |
lprintf "op_file_commit\n"; |
lprintf_nl "op_file_commit"; |
754 |
if c.op_file_save_as == cc.op_file_save_as then |
if c.op_file_save_as == cc.op_file_save_as then |
755 |
lprintf "op_file_save_as\n"; |
lprintf_nl "op_file_save_as"; |
756 |
if c.op_file_cancel == cc.op_file_cancel then |
if c.op_file_cancel == cc.op_file_cancel then |
757 |
lprintf "op_file_cancel\n"; |
lprintf_nl "op_file_cancel"; |
758 |
if c.op_file_pause == cc.op_file_pause then |
if c.op_file_pause == cc.op_file_pause then |
759 |
lprintf "op_file_pause\n"; |
lprintf_nl "op_file_pause"; |
760 |
if c.op_file_resume == cc.op_file_resume then |
if c.op_file_resume == cc.op_file_resume then |
761 |
lprintf "op_file_resume\n"; |
lprintf_nl "op_file_resume"; |
762 |
(* if c.op_file_disk_name == cc.op_file_disk_name then |
(* if c.op_file_disk_name == cc.op_file_disk_name then |
763 |
lprintf "op_file_disk_name\n"; *) |
lprintf_nl "op_file_disk_name"; *) |
764 |
if c.op_file_check == cc.op_file_check then |
if c.op_file_check == cc.op_file_check then |
765 |
lprintf "op_file_check\n"; |
lprintf_nl "op_file_check"; |
766 |
if c.op_file_recover == cc.op_file_recover then |
if c.op_file_recover == cc.op_file_recover then |
767 |
lprintf "op_file_recover\n"; |
lprintf_nl "op_file_recover"; |
768 |
if c.op_file_set_format == cc.op_file_set_format then |
if c.op_file_set_format == cc.op_file_set_format then |
769 |
lprintf "op_file_set_format\n"; |
lprintf_nl "op_file_set_format"; |
770 |
if c.op_file_all_sources == cc.op_file_all_sources then |
if c.op_file_all_sources == cc.op_file_all_sources then |
771 |
lprintf "op_file_all_sources\n"; |
lprintf_nl "op_file_all_sources"; |
772 |
if c.op_file_active_sources == cc.op_file_active_sources then |
if c.op_file_active_sources == cc.op_file_active_sources then |
773 |
lprintf "op_file_active_sources\n"; |
lprintf_nl "op_file_active_sources"; |
774 |
if c.op_file_print_html == cc.op_file_print_html then |
if c.op_file_print_html == cc.op_file_print_html then |
775 |
lprintf "op_file_print_html\n"; |
lprintf_nl "op_file_print_html"; |
776 |
if c.op_file_print_sources_html == cc.op_file_print_sources_html then |
if c.op_file_print_sources_html == cc.op_file_print_sources_html then |
777 |
lprintf "op_file_print_sources_html\n"; |
lprintf_nl "op_file_print_sources_html"; |
778 |
) !files_ops; |
) !files_ops; |
779 |
lprint_newline () |
lprintf_nl "" |
780 |
|
|
781 |
(*************************************************************************) |
(*************************************************************************) |
782 |
(* *) |
(* *) |
812 |
let file_verify file key begin_pos end_pos = |
let file_verify file key begin_pos end_pos = |
813 |
Unix32.flush_fd (file_fd file); |
Unix32.flush_fd (file_fd file); |
814 |
if !verbose_md4 then begin |
if !verbose_md4 then begin |
815 |
lprintf "Checksum to compute: %Ld-%Ld of %s\n" begin_pos end_pos |
lprintf_nl "Checksum to compute: %Ld-%Ld of %s" begin_pos end_pos |
816 |
(file_disk_name file); |
(file_disk_name file); |
817 |
end; |
end; |
818 |
try |
try |
834 |
in |
in |
835 |
let result = computed = key in |
let result = computed = key in |
836 |
if !verbose_md4 then begin |
if !verbose_md4 then begin |
837 |
lprintf "Checksum computed: %s against %s = %s\n" |
lprintf_nl "Checksum computed: %s against %s = %s" |
838 |
(string_of_uid key) |
(string_of_uid key) |
839 |
(string_of_uid computed) |
(string_of_uid computed) |
840 |
(if result then "VERIFIED" else "CORRUPTED"); |
(if result then "VERIFIED" else "CORRUPTED"); |
842 |
result |
result |
843 |
with |
with |
844 |
| Not_found -> raise Not_found |
| Not_found -> raise Not_found |
845 |
| _ -> if !verbose_md4 then lprintf "Checksum computed: chunk MISSING\n"; |
| _ -> if !verbose_md4 then lprintf_nl "Checksum computed: chunk MISSING"; |
846 |
false |
false |
847 |
|
|
848 |
let file_mtime file = Unix32.mtime64 (file_fd file) |
let file_mtime file = Unix32.mtime64 (file_fd file) |