caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Fox <dsfox@cogsci.ucsd.edu>
To: caml-list@inria.fr
Subject: [Caml-list] in_channel_length fails for files longer than max_int
Date: 14 May 2001 09:55:00 -0700	[thread overview]
Message-ID: <luitj3swez.fsf@hci.ucsd.edu> (raw)
In-Reply-To: William Chesters's message of "Sun, 13 May 2001 23:29:24 +0200 (CEST)"

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


             reply	other threads:[~2001-05-14 16:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <William Chesters's message of "Sun, 13 May 2001 23:29:24 +0200 (CEST)">
2001-05-14 16:55 ` David Fox [this message]
2001-05-13  6:24   ` Chris Hecker
2001-05-28 13:13   ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=luitj3swez.fsf@hci.ucsd.edu \
    --to=dsfox@cogsci.ucsd.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).