[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sys.getenv bug?



On Mon, Aug 30, 2004 at 03:38:15PM +0200, Johann Spies wrote:
> After complaining that I can not compile Pierre Weiss' htmlc he asked
> me to test Sys.getenv in the toplevel and this is what I get:
> # Sys.getenv "HOST";;
> Exception: Not_found.

On my installation ocaml behaviour is correct since I've no defined HOST
variable:

  zack@fistandantilus:~$ env | grep HOST
  zack@fistandantilus:~$ ocaml
          Objective Caml version 3.08.1

  # Sys.getenv "HOST";;
  Exception: Not_found.
  #
  zack@fistandantilus:~$ export HOST=foo
  zack@fistandantilus:~$ ocaml
          Objective Caml version 3.08.1

  # Sys.getenv "HOST";;
  - : string = "foo"
  #

as you can see, ocaml do the right thing.

> According to him an error like this indicates a "strange" ocaml
> installation.

Probably he is assuming that all of us have a defined HOST variable but
this is not true, at least not for default debian installation.

BTW I can't understand why he relies on that variable when he could use
the "hostname" command as anyone else ...

Cheers.

-- 
Stefano Zacchiroli -*- Computer Science PhD student @ Uny Bologna, Italy
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
If there's any real truth it's that the entire multidimensional infinity
of the Universe is almost certainly being run by a bunch of maniacs. -!-

Attachment: signature.asc
Description: Digital signature


Reply to: