Important information: this site is currently scheduled to go offline indefinitely by end of the year.

DELETED

Coders and would-be coders alike, this is the place to talk about programming.
Post Reply
NecessAndAry
n00b
Posts: 10
Joined: Tue Dec 28, 2010 2:51 am
Been thanked: 1 time

DELETED

Post by NecessAndAry »

DELETED
Last edited by NecessAndAry on Sun Jul 22, 2012 11:49 pm, edited 1 time in total.
Rheini
Moderator
Posts: 652
Joined: Wed Oct 18, 2006 9:48 pm
Location: Germany
Has thanked: 19 times
Been thanked: 46 times
Contact:

Re: C(++) file reading/writing

Post by Rheini »

invisghost
advanced
Posts: 55
Joined: Tue Jul 13, 2010 7:16 pm
Has thanked: 1 time
Been thanked: 11 times

Re: C(++) file reading/writing

Post by invisghost »

Failing to read at 1gb is an odd size to fail at. The 32bit limit is 4gb and it might also fail at 2gb for a few reasons. Have you checked if you're running out of memory? You can read bigger files if needed but you have to read them in chunks. You cant just do a single fread() call because you aren't able to hold the entire file in memory (32bit limitation). :)
VoLT
ultra-n00b
Posts: 3
Joined: Fri Aug 13, 2010 1:39 pm
Location: Russia

Re: C(++) file reading/writing

Post by VoLT »

not sure ... maybe so

Code: Select all

int m_fh;
__int64 pos;
int	sz;
BYTE	bIGbuff[BUFFER_SIZE]={0};
_lseeki64(m_fh, pos, SEEK_SET);
_read( m_fh, bIGbuff, sz )
more examples http://msdn.microsoft.com/en-us/library ... s.80).aspx
PS Work in 32 and 64 bit
PPS Support large 4Gb files
Post Reply