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 SAA01579; Mon, 14 May 2001 18:55:04 +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 SAA01574 for ; Mon, 14 May 2001 18:55:03 +0200 (MET DST) Received: from hci.ucsd.edu (hci.ucsd.edu [132.239.215.210]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f4EGt1505136 for ; Mon, 14 May 2001 18:55:02 +0200 (MET DST) Received: (from dsf@localhost) by hci.ucsd.edu (8.9.3/8.9.3) id JAA12604; Mon, 14 May 2001 09:55:00 -0700 To: caml-list@inria.fr Subject: [Caml-list] in_channel_length fails for files longer than max_int From: David Fox Date: 14 May 2001 09:55:00 -0700 In-Reply-To: William Chesters's message of "Sun, 13 May 2001 23:29:24 +0200 (CEST)" Message-ID: X-Mailer: Gnus v5.7/Emacs 20.3 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The pervasive function in_channel_length fails when the file size is too large for an int, but it doesn't raise an exception. The code in io.c just checks for lseek errors. Would a check for end > max_int be worthwhile? long channel_size(struct channel *channel) { long end; end = lseek(channel->fd, 0, SEEK_END); if (end == -1 || lseek(channel->fd, channel->offset, SEEK_SET) != channel->offset) { sys_error(NO_ARG); } return end; } ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr