diff options
author | Alain Frisch <alain@frisch.fr> | 2007-06-01 14:56:50 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2007-06-01 14:56:50 +0000 |
commit | ecf86b7b44ee5b8f676c1b9ff0b00971523e4123 (patch) | |
tree | d043aca3778b20032ec0cbd620dbd1b77b42ddb0 | |
parent | 556f5e8d53938f7fbd24f90077556fdfe12fe2c7 (diff) | |
download | ocaml-ecf86b7b44ee5b8f676c1b9ff0b00971523e4123.tar.gz |
*** empty log message ***
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/natdynlink@8305 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | toplevel/opttopdirs.ml | 9 | ||||
-rw-r--r-- | toplevel/opttoploop.ml | 5 |
2 files changed, 11 insertions, 3 deletions
diff --git a/toplevel/opttopdirs.ml b/toplevel/opttopdirs.ml index 13d17bbeec..5c63052262 100644 --- a/toplevel/opttopdirs.ml +++ b/toplevel/opttopdirs.ml @@ -51,8 +51,13 @@ let _ = Hashtbl.add directive_table "cd" (Directive_string dir_cd) (* Load in-core a .cmxs file *) -let load_file ppf name = - let name = find_in_path !Config.load_path name in +let load_file ppf name0 = + let name = + try Some (find_in_path !Config.load_path name0) + with Not_found -> None in + match name with + | None -> fprintf ppf "File not found: %s@." name0; false + | Some name -> let fn,tmp = if Filename.check_suffix name ".cmx" || Filename.check_suffix name ".cmxa" then diff --git a/toplevel/opttoploop.ml b/toplevel/opttoploop.ml index 33354bec9d..98f52ea84a 100644 --- a/toplevel/opttoploop.ml +++ b/toplevel/opttoploop.ml @@ -140,7 +140,10 @@ let load_lambda ppf (size, lam) = then Filename.concat (Sys.getcwd ()) dll else dll in let res = dll_run dll !phrase_name in - Sys.remove dll; + (try Sys.remove dll with Sys_error _ -> ()); + (* note: under windows, cannot remove a loaded dll + (should remember the handles, close them in at_exit, and then remove + files) *) res (* Print the outcome of an evaluation *) |