Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-01-14 (20:53)
From: Johann Spies <jhspies@a...>
Subject: exec?
I am a newbie learning ocaml.  In a demo using 
libpq_ocaml I found a command 'exec':
let query_res conn s expect =
  let msg label info =
    if not (info="") then printf "%s: %s\n" label info;
    flush stdout
  printf "Query: %s\n" s;
  let res = exec conn s in
  msg "Error message" (resultErrorMessage res);
  let status = resultStatus res in
  if not (expect = status) then
    printf "Expecting [%s], getting [%s]\n" 
      (resStatus expect) (resStatus status);
    finish conn;
    exit 1;

It was used only once in this program and I could find nothing in any
other ocaml examples or in the documentation explaining it.

The closest I got was 

" Cannot exec camlrun  (When launching a self-executable bytecode file.) The
   ocamlrun  could not be found in the executable path. Check that Objective
   Caml  has been properly installed on your system."

and some explainations about execv, execve and execvp in 

                             The Objective Caml system
                                  release 3.00
                         Documentation and user's manual
                                  Xavier Leroy.

Can somebody explain this command to me please with some examples on
how to use it?


J.H. Spies - Tel. 082 782 0336 
     "If we confess our sins, he is faithful and just to 
      forgive us our sins, and to cleanse us from all  
      unrighteousness."          I John 1:9