473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

FREAD fails on files >4GB

Howdy

Problem with the fread() call on MS Visual Studio 2005 running under Win 64.

The parameters to fread size and count are both size_t ie 64 bits. Even
so the call fails when the size arg is greater than 4GB (ie exceeds 32
bit unsigned value).

Any suggestions.

Thanks in advance.
Jul 30 '08 #1
7 4611
In article <g6**********@aioe.org>, Richie Kernagan <ho***@pot.inalidwrote:
>Problem with the fread() call on MS Visual Studio 2005 running under Win 64.
Hmmm, then why post to comp.compilers.lcc ???

>The parameters to fread size and count are both size_t ie 64 bits. Even
so the call fails when the size arg is greater than 4GB (ie exceeds 32
bit unsigned value).
Either there is a bug in your code (which you don't show us)
or there is a bug in the MS Visual Studio 2005 support library.
If you wish to investigate the possibility of a bug in
MS Visual Studio 2005 then you should do so in an OS-specific
forum or on one of microsoft's web sites. If you wish to investigate
that the possibility of a bug in your code, you will need to post
compilable code that we could test with... preferrably code that
specifically outputs the size of size_t so that we can see with
our own eyes that you haven't accidently been mistaken about
how big size_t is on the system.
--
"After all, what problems has intellectualism ever solved?"
-- Robert Gilman
Jul 30 '08 #2
On Jul 31, 1:30 am, Richie Kernagan <ho...@pot.inalidwrote:
Howdy

Problem with the fread() call on MS Visual Studio 2005 running under Win 64.

The parameters to fread size and count are both size_t ie 64 bits. Even
so the call fails when the size arg is greater than 4GB (ie exceeds 32
bit unsigned value).
So what? fread can succeed or fail.
Jul 30 '08 #3
On 30 Jul 2008 at 23:44, vi******@gmail.com wrote:
On Jul 31, 1:30 am, Richie Kernagan <ho...@pot.inalidwrote:
>The parameters to fread size and count are both size_t ie 64 bits. Even
so the call fails when the size arg is greater than 4GB (ie exceeds 32
bit unsigned value).

So what? fread can succeed or fail.
Great. Just great.

When an implementation deviates by a tiny fraction from the golden
tablets of The Standard, the people here come down on it like a ton of
bricks. But as long as it obeys the letter of the law, noone minds how
poor the quality of implementation might be.

Do malloc() and fopen() always return NULL? No problem! That's OK
according to The Standard. Of course it makes no difference to "vip
star" and his friends, as it's clear they never actually program C in
the real world, so a program in the abstract machine that always
terminates gracefully with an informative error message like
"Program failed at line 1 - this implementation always returns NULL to
malloc()"
is just fine for them...just as long as the return type of main() is
right.

Jul 31 '08 #4
In article <sl*******************@nospam.invalid>,
Antoninus Twink <no****@nospam.invalidwrote:
>On 30 Jul 2008 at 23:44, vi******@gmail.com wrote:
>On Jul 31, 1:30 am, Richie Kernagan <ho...@pot.inalidwrote:
>>The parameters to fread size and count are both size_t ie 64 bits. Even
so the call fails when the size arg is greater than 4GB (ie exceeds 32
bit unsigned value).
>So what? fread can succeed or fail.
>Great. Just great.
>When an implementation deviates by a tiny fraction from the golden
tablets of The Standard, the people here come down on it like a ton of
bricks. But as long as it obeys the letter of the law, noone minds how
poor the quality of implementation might be.
The quality of any particular implementation is relevant to
newsgroups that deal with that particular implementation, and not
relevant to comp.lang.c, which deals with the C language rather than
with implementations.
--
"To burn always with this hard, gem-like flame, to maintain this
ecstasy, is success in life." -- Walter Pater
Jul 31 '08 #5
Richie Kernagan wrote:
Howdy

Problem with the fread() call on MS Visual Studio 2005 running under
Win 64.

The parameters to fread size and count are both size_t ie 64 bits.
Even so the call fails when the size arg is greater than 4GB (ie
exceeds 32 bit unsigned value).

Any suggestions.

Thanks in advance.
In many cases additional flags must be defined for an implementation to
support files larger than 4 Gb. Verify that you have done so. Any such
requirement should be documented in the reference documentation for
your implementation.

Also post your actual code that fails (as minimal an example as
possible), along with details of fread's input and output, and the
exact error that you have detected.

Jul 31 '08 #6
On 2008-07-30 23:30:34 +0100, Richie Kernagan <ho***@pot.inalidsaid:
Howdy

Problem with the fread() call on MS Visual Studio 2005 running under Win 64.

The parameters to fread size and count are both size_t ie 64 bits. Even
so the call fails when the size arg is greater than 4GB (ie exceeds 32
bit unsigned value).

Any suggestions.

Thanks in advance.
I never use VS 2005 so I don't know if it is true or not but does it
have an fread64() function in its library at all? Some systems do, I
just do not know if the Microsoft implementation is one.

--
"I disapprove of what you say, but I'll defend to the death your right
to say it." - Voltaire

Jul 31 '08 #7
ro******@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote:
In article <g6**********@aioe.org>, Richie Kernagan <ho***@pot.inalidwrote:
Problem with the fread() call on MS Visual Studio 2005 running under Win 64.

Hmmm, then why post to comp.compilers.lcc ???
Crossposted to a newsgroup where this clearly doesn't belong.

Added a follow-up (so the crosspost was no accident or lack of thought).

Used _that_ nick.
Oh my, what could possibly be happening here?

Richard
Aug 1 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Stubbs | last post by:
Hi, I wonder if anybody here is using MySQL (3.23.56?) on a linux/intel ia32 (e.g., Xeon) with more than 4 GB RAM? Did you find a performance enhancement? With PAE mode on? How does this affect...
3
by: DotNetJunkies User | last post by:
The HTMLInputFile control works fine up to 25 MB with changing MaxRequestLen in web.config but didn't work for greater size of the file..does anybody have the idea how to do that.?? --- Posted...
8
by: Uncle Ben | last post by:
I'm looking for an ASP.NET solution which will allow my website to receive huge files in the size of 4GB and up. This solution needs to be integrated with a front-end. Users will have to...
3
by: Paul Spielvogel | last post by:
I need to compute the MD5 hash on VERY large files 500mb to 4gb+ I have found two ways but neither one of them does what i need. Private Function ComputeDataMD5(ByVal path As String) As String...
2
by: =?Utf-8?B?TWljaGFlbCBTbGF0dGVyeQ==?= | last post by:
Is there any way to get progress from FileStream or MD5CryptoServiceProvider while generating MD5 Hashes on large files (>4GB). Or can I use a byte buffer to generate MD5 hashs that combine to...
2
by: robert | last post by:
Somebody who uses my app gets a error : os.stat('/path/filename') OSError: Value too large for defined data type: '/path/filename' on a big file >4GB ( Python 2.4.4 / Linux )
17
by: byte8bits | last post by:
How does C++ safely open and read very large files? For example, say I have 1GB of physical memory and I open a 4GB file and attempt to read it like so: #include <iostream> #include <fstream>...
19
by: Robert Kochem | last post by:
Hi, I am relative new to C++ regarding it's functions and libraries. I need to access files larger than 4GB which is AFAIK not possible with the STL iostream - at least not if using a 32 bit...
0
by: Gordon | last post by:
On Oct 6, 3:26 pm, jimbob<nos...@virgingmedio.comwrote: You might want to file a bug report at php.net and hope it gets looked into and resolved, other than that I don't think there's a solution.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.