OCaml Forge

Detail: [#1278] Sys.chdir causes re-execution of #directory directive

Bugs: Browse | Download .csv | Monitor

[#1278] Sys.chdir causes re-execution of #directory directive

Date:
2013-05-21 13:33
Priority:
3
State:
Open
Submitted by:
Ashish Agarwal (ashish_agarwal)
Assigned to:
Nobody (None)
Hardware:
None
Resolution:
None
Severity:
None
Version:
None
Component:
None
Operating System:
None
Product:
None
 
URL:
Summary:
Sys.chdir causes re-execution of #directory directive

Detailed description
$ pwd
/Users/ashish/code/biocaml

$ cat .ocamlinit
#use "topfind"
#thread
#require "core"
#require "zip"
#require "xmlm"
#require "pcre"
#directory "_build/src/lib"
#load "biocaml.cma"

$ ocaml

# Sys.chdir "/";;
- : unit = ()
(* No errors *)

Now, use utop instead:

$ utop
utop # Sys.chdir "/";;
- : unit = () Fatal error: exception (Sys_error "_build/src/lib: No such file or directory") Raised at file "format.ml", line 197, characters 41-52
Called from file "format.ml", line 425, characters 8-33
Called from file "format.ml", line 440, characters 6-24

Note my .ocamlinit file has a #directory directive, which appears to be re-executed after the call to Sys.chdir. The relative directory no longer is valid, and hence the error.

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item