From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 76EDB7FDE1 for ; Wed, 27 Jul 2016 18:56:48 +0200 (CEST) IronPort-PHdr: 9a23:bhZ9sBJTnBLM+yGg8dmcpTZWNBhigK39O0sv0rFitYgULvnxwZ3uMQTl6Ol3ixeRBMOAuqoC1bed4vGocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+kQsiM0o/mhqibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtM0rzyMFl/cg69RBQO3fYr8xUb9ZCnxyP2Ux6cTzuAPrQg6G539aWWITxElmGQ/AuTj2RJb8tGPcv+ZwwmHONMHsTL0ycTKl86QtTwXn3nRUfwUl+X3a35QjxJlQpwis8kRy Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=adrien@notk.org; spf=Pass smtp.mailfrom=adrien@notk.org; spf=None smtp.helo=postmaster@nautica.notk.org Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D5AgB855hX/5NHeVtdgz+6QYF9hh0CgTQ4FAEBAQEBAQEBXCdBDgGBYhWCFgEFI1YQCw4KAgIFEw4CAg8FGDGISK5hjVABAQgCASSBAYUphE2HQSuCEh0BBJkxjnIKaY5XjC2DeB42g3o6gkaEaCqBGgEBAQ X-IPAS-Result: A0D5AgB855hX/5NHeVtdgz+6QYF9hh0CgTQ4FAEBAQEBAQEBXCdBDgGBYhWCFgEFI1YQCw4KAgIFEw4CAg8FGDGISK5hjVABAQgCASSBAYUphE2HQSuCEh0BBJkxjnIKaY5XjC2DeB42g3o6gkaEaCqBGgEBAQ X-IronPort-AV: E=Sophos;i="5.28,430,1464645600"; d="scan'208";a="186127555" Received: from nautica.notk.org ([91.121.71.147]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Jul 2016 18:56:36 +0200 Received: by nautica.notk.org (Postfix, from userid 1003) id 77623C01D; Wed, 27 Jul 2016 18:56:35 +0200 (CEST) Date: Wed, 27 Jul 2016 18:56:35 +0200 From: Adrien Nader To: Dmitriy Musatkin Cc: caml-list@inria.fr Message-ID: <20160727165635.GA19492@notk.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Strange File IO bug Hi, On Tue, Jul 26, 2016, Dmitriy Musatkin wrote: > Hi all, > > I maintain a small OCaml program that generates some data, writes it to a > temporary file and creates another process, which then reads that temporary > file. Recently, I've received a few reports from users that the program > generates an empty file when it should not. All of the affected users run > either 64bit Win7 or Win10. I have access to one of those users' machines, > and I can reproduce the issue consistently, however I'm not able to > reproduce the issue on any other machine. > > The file io part looks something like following: > let oc = open_out_bin file in > output_string oc s; > close_out oc > Most probably, "flush oc" before "close oc": out_channel is buffered. :) -- Adrien Nader