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 NAA11702; Mon, 4 Oct 2004 13:13:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA09638 for ; Mon, 4 Oct 2004 13:13:26 +0200 (MET DST) Received: from web53209.mail.yahoo.com (web53209.mail.yahoo.com [206.190.39.225]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id i94BDPw9018192 for ; Mon, 4 Oct 2004 13:13:26 +0200 Message-ID: <20041004111325.69884.qmail@web53209.mail.yahoo.com> Received: from [155.97.235.144] by web53209.mail.yahoo.com via HTTP; Mon, 04 Oct 2004 04:13:25 PDT Date: Mon, 4 Oct 2004 04:13:25 -0700 (PDT) From: Andy Yang Subject: [Caml-list] Wierd behavior of file reading when tried to start an executable in Ocaml code To: caml-list@inria.fr In-Reply-To: <012676D607FCF54E986746512C22CE7D0FE7AD@orsmsx407> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at concorde with ID 41613055.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; debugging:01 721:99 ocaml:01 ocaml:01 unix:02 unix:02 executable:03 behavior:03 execute:04 yang:06 correctly:08 frustrating:09 rather:09 rather:09 inside:10 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, I am trying to call some outside exectuables in Ocaml code. So I tried Unix.system and Unix.exec. However I found that the program cannot execute correctly if it is called from Ocaml code, and at the same time it can work smoothly if I run it directly from a console. This program is a very simple console program, with two files as its input. When I look into the code and put some debugging code to print internal information out, I found that when I start the program from Ocaml code, the last several lines of the input file are ignored. I added several extrae line at the end of the file and tried again. The lines I added are still ignored. The file is a simple text file, the final line looks like this: 'CONF: 721 == 45 119 124'. It is rather simple, right? I found that when I tried to start the program inside Ocaml, the program will ignore the last line. It is rather wierd and frustrating. Any suggestions and insights are welcome. Thanks. Andy __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners