diff options
Diffstat (limited to 'lib/system.ml')
-rw-r--r-- | lib/system.ml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/system.ml b/lib/system.ml index 854c5dbdb..e0ec7b3ea 100644 --- a/lib/system.ml +++ b/lib/system.ml @@ -255,6 +255,13 @@ let extern_intern ?(warn=true) magic suffix = in (extern_state,intern_state) +let with_magic_number_check f a = + try f a + with Bad_magic_number fname -> + errorlabstrm "with_magic_number_check" + (str"File " ++ str fname ++ strbrk" has bad magic number." ++ spc () ++ + strbrk "It is corrupted or was compiled with another version of Coq.") + (* Communication through files with another executable *) let connect writefun readfun com = |