From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 65DFBBCDE for ; Tue, 30 Nov 2004 21:04:37 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAUK4bVj008682 for ; Tue, 30 Nov 2004 21:04:37 +0100 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 VAA22778 for ; Tue, 30 Nov 2004 21:04:36 +0100 (MET) Received: from mail.ece.ucsb.edu (mail.ece.ucsb.edu [128.111.56.51]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id iAUK4XFs008673 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 30 Nov 2004 21:04:36 +0100 Received: from [192.168.0.200] (ip68-6-103-180.sb.sd.cox.net [68.6.103.180]) (authenticated bits=0) by mail.ece.ucsb.edu (8.13.1/8.13.0) with ESMTP id iAUK4RIv026433 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO) for ; Tue, 30 Nov 2004 12:04:32 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v619) Content-Transfer-Encoding: 7bit Message-Id: <094A5274-430B-11D9-BD00-003065BDAA76@ece.ucsb.edu> Content-Type: text/plain; charset=US-ASCII; format=flowed To: caml-list From: Shivkumar Chandrasekaran Subject: Bug: mingw in_channel_length fails Date: Tue, 30 Nov 2004 12:04:26 -0800 X-Mailer: Apple Mail (2.619) X-Miltered: at concorde with ID 41ACD255.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41ACD251.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; shivkumar:01 ucsb:01 bug:01 mingw:01 largefile:01 ocaml:01 mingw:01 windowsxp:01 fname:01 largefile:01 ocaml:01 bug:01 --shiv--:01 exception:01 exception:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Hi, I just noticed that both in_channel_length and LargeFile.in_channel_length report the wrong values on files that are greater than some number (in my case 2GB) using ocaml 3.08.1 mingw (WindowsXP SP2) build (compiled following instructions). In particular I ran the same snippet of code: let fd_in = open_in_bin "fname";; in_channel_length fd_in;; LargeFile.in_channel_length fd_in;; on the same file in Mac OS X, Linux (x86), and mingw. In the first two cases in_channel_length throws an exception: Exception: Sys_error "Value too large to be stored in data type". while LargeFile.in_channel_length returns: - : int64 = 2621440000L which is correct (doing ls -l in shell). In the mingw version I get 473956352 for in_channel_length and -1673527296L for LargeFile.in_channel_length (note the negative value)! EIther I messed up while building from ocaml sources, or this seems to be a mingw specific bug. Thanks for any help. --shiv-- PS: I can send the file if somebody wishes to cross-check.