473,804 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ 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 4642
In article <g6**********@a ioe.org>, Richie Kernagan <ho***@pot.inal idwrote:
>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.inal idwrote:
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.inal idwrote:
>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.inal idwrote:
>>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.inal idsaid:
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.nr c-cnrc.gc.ca (Walter Roberson) wrote:
In article <g6**********@a ioe.org>, Richie Kernagan <ho***@pot.inal idwrote:
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
1838
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 MySQL - being a multithreaded process, is there any benefit in having all that extra memory as anything other than a big disk cache? If anybody is familiar with this scenario, I'd be very grateful for your insights.
3
2110
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 using Wimdows.net NntpNews Component - Post Made from http://www.DotNetJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.
8
3201
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 populate some FORM fields and browse for the 4GB file. Upon FORM submission, the application will collect both the FORM field data and the 4GB upload. A file transfer progress bar would be nice too.
3
6472
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 Dim fi As New FileInfo(path) Dim fs As FileStream = fi.OpenRead() fs = fi.OpenRead Dim Md5 As New MD5CryptoServiceProvider
2
2169
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 create a final hash? StringBuilder sb = new StringBuilder(); MD5 md5 = new MD5CryptoServiceProvider(); byte hash = md5.ComputeHash(fs); fs.Close();
2
3202
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
9965
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> #include <string> using namespace std; int main () {
19
7383
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 compiler. iostream was my favorite as my code has to work on files as well as memory buffers... Could somebody please help me what functions/classes are the best in this case?
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
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10311
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7613
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4292
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 we have to send another system
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2988
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.