From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id GAA08941; Wed, 12 Sep 2001 06:50:16 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id GAA08801 for ; Wed, 12 Sep 2001 06:50:15 +0200 (MET DST) Received: from jupiter.duonix.com ([211.41.0.239]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f8C4oDT28685 for ; Wed, 12 Sep 2001 06:50:13 +0200 (MET DST) Received: from hama (hama.duonix.com [192.168.1.30]) by jupiter.duonix.com (8.11.2/8.11.2) with SMTP id f8C4ooi04103 for ; Wed, 12 Sep 2001 13:50:51 +0900 Message-ID: <009201c13b46$d5ad2bd0$1e01a8c0@hama> From: "SooHyoung Oh" To: "caml-list" Subject: [Caml-list] library dynamic loading ? Date: Wed, 12 Sep 2001 13:53:15 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="ks_c_5601-1987" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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