* [Caml-list] library dynamic loading ?
@ 2001-09-12  4:53 SooHyoung Oh
  2001-09-12  7:15 ` Sven
  0 siblings, 1 reply; 2+ messages in thread
From: SooHyoung Oh @ 2001-09-12  4:53 UTC (permalink / raw)
  To: caml-list
Hi!
Is it possible to load library dynamically?
Here are my trials; Did I miss something or is it impossible to load library
dynamically?
(1) First,  I made toplevel system with unix library
    $ ocamlmktop -o unixtop unix.cma
(2) GOOD!!!: It's OK to execute a script
    $ cat fread
    open Unix;;
    let buffer = String.create 100 in
    let fd = openfile "demo.txt" [O_RDONLY] 0 in
    let n = read fd buffer 0 100 in
    let err = write stdout buffer 0 n in
    close fd;;
    $ unixtop fread
    Hello
(3) Fail 1: dynamic load of unix library
    $ ocaml unix.cma fread
    File "/usr/lib/ocaml/threads/unix.cma", line 1, characters 12-13:
    Illegal character (\000)
(4) Fail 2: dynamic load of library
    $ cat fread2
    #load “unix.cma”;;
    ... (same as fread)
    $ ocaml fread2
    The external function `unix_read' is not available
--- SooHyoung Oh
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr
^ permalink raw reply	[flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-12  7:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-12  4:53 [Caml-list] library dynamic loading ? SooHyoung Oh
2001-09-12  7:15 ` Sven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox