caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Olivier Andrieu <oandrieu@nerim.net>
To: Garry Hodgson <garry@sage.att.com>, caml-list@inria.fr
Subject: Re: [Caml-list] error opening large file
Date: Fri, 11 Jan 2002 22:51:00 +0100	[thread overview]
Message-ID: <15423.24132.197969.118641@karryall.nerim.net> (raw)
In-Reply-To: <3C3F52ED.2F4B0190@sage.att.com>

 Garry Hodgson [Friday 11 January 2002] :
 > 
 > i get the following error when i open a large file (2561435180 bytes):
 > 
 >    let chan = open_in( "com.zone" );;
 >    Uncaught exception:
 >    Sys_error
 >    "com.zone: Value too large for defined data type".
 > 
 > is there a 2G file size limitation? if so, why?

The problem might be with your C library which doesn't use 64 bits
file offsets for the usual I/O functions (open, lseek ...). On my
redhat 7.2, opening a >2G file works OK.

BUT, looking at the ocaml source code, I see that the offset in the
file is coded with a 'long' which is a bit problematic.

Maybe some I/O funtions with int64 arguments could be added to the
standard library (at least for the low-level functions of module
Unix) ?


        Objective Caml version 3.04

# let ic = open_in "hom.genom.fa" ;;
val ic : in_channel = <abstr>
# let s = String.make 20 ' ' ;;                         
val s : string = "                    "
# let _ = input ic s 0 20 in s ;;
- : string = ">chr10\nCCGTGGTGAAGAC"
# in_channel_length ic ;;
- : int = -848525384
#

-- 
   Olivier
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2002-01-14 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-11 21:02 Garry Hodgson
2002-01-11 21:51 ` Olivier Andrieu [this message]
2002-01-15  9:56 ` Xavier Leroy
2002-01-16  8:53   ` Florian Douetteau
2002-01-23 15:49     ` Xavier Leroy
2002-01-11 23:32 Florian Douetteau
2002-01-12  0:02 ` David Monniaux

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=15423.24132.197969.118641@karryall.nerim.net \
    --to=oandrieu@nerim.net \
    --cc=caml-list@inria.fr \
    --cc=garry@sage.att.com \
    /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).