Ticket #1771 (closed merge: fixed)

Opened 6 years ago

Last modified 5 years ago

hFileSize gives negative values

Reported by: guest Owned by: igloo
Priority: normal Milestone: 6.8.3
Component: libraries/base Version: 6.6.1
Keywords: hFileSize >2gb Cc:
Operating System: Windows Architecture: x86
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

hFileSize gives negative values for very big files.

Tested several times it works properly except in two files. They have
- 2.936.134.256 bytes
- 3.846.960.665 bytes

They are in NTFS in Windows XP SP2. Not able to test in Fat or in other OS.

The next biggest file was 1.154.008.883 bytes and it worked fine.

Change History

Changed 6 years ago by igloo

  • milestone set to 6.8 branch
hFileSize :: Handle -> IO Integer

so there's no good reason for this at the Haskell interface level. We probably need to call a different C function to allow for larger values.

Changed 6 years ago by guest

  • keywords >2gb added

This function is _filelengthi64. But don't forget to correct hSeek/hTell too. It's part of "New Haskell I/O library" drama which has long, long story :)

one possible temporary solution is to use my Streams library ( http://haskell.org/haskellwiki/Library/Streams) which supports large files

Changed 6 years ago by guest

  • component changed from Compiler to libraries/base

Changed 6 years ago by simonmar

  • milestone changed from 6.8 branch to 6.8.3

Changed 5 years ago by simonmar

  • owner set to igloo
  • type changed from bug to merge

To merge (libraries/base patch):

Wed Jan 23 10:29:04 GMT Standard Time 2008  Simon Marlow <simonmar@microsoft.com>
  * Windows: large file support for hFileSize and hSeek (#1771)

Changed 5 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Merged

Note: See TracTickets for help on using tickets.