From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 632EEBBAF for ; Tue, 29 Jun 2010 13:52:06 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AscBAHt7KUzRVdY2mGdsb2JhbACTBYwuCBUBAQEBAQgJDAcRIq4OCoF/hWEuiFMBAQMFhR8EjkI X-IronPort-AV: E=Sophos;i="4.53,503,1272837600"; d="scan'208";a="53337782" Received: from mail-bw0-f54.google.com ([209.85.214.54]) by mail3-smtp-sop.national.inria.fr with ESMTP; 29 Jun 2010 13:52:06 +0200 Received: by bwz12 with SMTP id 12so917569bwz.27 for ; Tue, 29 Jun 2010 04:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=iapU+YzfcJKx3k/ngz4g5bQK6ScjpDkpbNa0XboL57M=; b=PtmVy44Tbp0s8rxkX0hNC4RC+EwDgbPNA6qOTNdUGPs5s8cg23P3KZV0tZMrt/6lb0 SYI8Avq+68EsSRg03IA7BiNbR3iMhSBNJsoQ6zgyqvm6WrxdfnrJVTvlbdcNhFkbDivx rF80jmm9dUqeSw4sn0vDIoOWLLLYeqNFoJZfU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=PXkVWrVxPF7bdmqkgheuED3bPrAjW31IXXHt+8m4iMvulwec8AVzvLCSlUXXTNVx0f yOhaKM53d6q7v0WPzD9y3iKavB32pOX1ePctjYtzZwWqf52PaQ7iMPrJW1rrBfIx0KWa tFaElH6+qy/bmQjn0bw6JHB9JHoIM7N+2D+Rw= Received: by 10.204.132.207 with SMTP id c15mr3310972bkt.103.1277812325616; Tue, 29 Jun 2010 04:52:05 -0700 (PDT) Received: from [172.17.0.15] (papillon.metalscan.fr [93.95.58.150]) by mx.google.com with ESMTPS id bl19sm2405305bkb.18.2010.06.29.04.52.03 (version=SSLv3 cipher=RC4-MD5); Tue, 29 Jun 2010 04:52:04 -0700 (PDT) Message-ID: <4C29DE63.3040607@gmail.com> Date: Tue, 29 Jun 2010 13:52:03 +0200 From: Matthieu Dubuget Reply-To: matthieu.dubuget@gmail.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9pre) Gecko/20100217 Lightning/1.0b1 Shredder/3.0.3pre MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Calling OCaml from C - nothing shown on stdout References: <4C29CE90.60708@web.de> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; matthieu:01 dubuget:01 matthieu:01 dubuget:01 ocaml:01 stdout:01 ocaml:01 stdout:01 printf:01 printf:01 kprintf:01 kprintf:01 caml-list:01 caml-list:01 string:02 -------- Original Message -------- Subject: Re: [Caml-list] Calling OCaml from C - nothing shown on stdout From: David Allsopp To: 'Andreas Sommer' , 'caml-list@yquem.inria.fr' Date: 29/06/2010 13:18 > > 2. Insert a flush stdout statement after each Printf.printf call. Better, create another function using Printf.kprintf which flushes stdout each time: > let flushed_printf x = Printf.kprintf (fun s -> print_string s; flush stdout) in > flushed_printf "%s" "Finished with..." > Or use "%!" in your string format to flush. Salutations Matt