473,491 Members | 3,350 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4619
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
1824
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
2077
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
3184
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
6435
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
2159
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
3180
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
9865
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
7328
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
557
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
6980
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
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7192
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
7364
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...
1
4886
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3087
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.