Version française
Home     About     Download     Resources     Contact us    
Browse thread
exec?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
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
  in
  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
  begin
    printf "Expecting [%s], getting [%s]\n" 
      (resStatus expect) (resStatus status);
    finish conn;
    exit 1;
  end;
  res
--------------------------------------

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?

Regards.

Johann
-- 
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