Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mingw in_channel_length fails #3324

Closed
vicuna opened this issue Dec 2, 2004 · 1 comment
Closed

mingw in_channel_length fails #3324

vicuna opened this issue Dec 2, 2004 · 1 comment
Labels

Comments

@vicuna
Copy link

vicuna commented Dec 2, 2004

Original bug ID: 3324
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Shivkumar Chandrasekaran
Version: 3.08.2
OS: WindowsXP
Submission from: gimli.ece.ucsb.edu (128.111.56.252)

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 (and 3.08.2) 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, Gentoo 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.

@vicuna
Copy link
Author

vicuna commented Feb 2, 2005

Comment author: administrator

Fixed in trunk by XL 2004-02-02. Not fixed in 3.08 bugfix branch because change
causes problems with my really old version of VC++.

@vicuna vicuna closed this as completed Feb 2, 2005
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant