Click here to Skip to main content
15,924,402 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow much memory does a process have? Pin
Victor Volkman6-Sep-02 10:18
sussVictor Volkman6-Sep-02 10:18 
AnswerRe: How much memory does a process have? Pin
Stephane Rodriguez.6-Sep-02 10:47
Stephane Rodriguez.6-Sep-02 10:47 
AnswerRe: How much memory does a process have? Pin
Mike Nordell6-Sep-02 17:57
Mike Nordell6-Sep-02 17:57 
GeneralRe: How much memory does a process have? Pin
sysop@HAL9K.com9-Sep-02 2:00
sysop@HAL9K.com9-Sep-02 2:00 
GeneralOffice 2000 vs Office 2002 Pin
Anonymous6-Sep-02 9:55
Anonymous6-Sep-02 9:55 
GeneralRe: Office 2000 vs Office 2002 Pin
Todd Smith6-Sep-02 17:30
Todd Smith6-Sep-02 17:30 
GeneralRe: Office 2000 vs Office 2002 Pin
Anonymous8-Sep-02 6:22
Anonymous8-Sep-02 6:22 
GeneralVery Large Files and CFile Pin
achandra0076-Sep-02 9:51
achandra0076-Sep-02 9:51 
This is what I am trying to do:

We have a very large file (over 2Gb) that has a special character at the very end that we wish to remove.

The approach I have taken is to seek the end of the file and then reading the very last line. Once I have read the last line, I manipulate this with a CString object and remove the unwanted character(s). Once I have done that, I reset the length of the file and the write out a new line which is my modified CString object.

My problem is that since the file is very large, my CFile::SetLength(...) function is bombing. I get a Bad File Seek exception everytime. This is because the size of the file, according to the CFileStatus object's m_size variable is a negative number. When I supply the modified size to SetLenth, it casts it to a LONG and the calls the Seek function. When the Seek gets called, the number becomes negative and I get an exception.

Is there a way around this? A better way of doing this perhaps?

thanks
ashish

GeneralRe: Very Large Files and CFile Pin
Stephane Routelous6-Sep-02 10:25
Stephane Routelous6-Sep-02 10:25 
GeneralRe: Very Large Files and CFile Pin
TyMatthews6-Sep-02 13:10
TyMatthews6-Sep-02 13:10 
GeneralRe: Very Large Files and CFile Pin
Mike Nordell6-Sep-02 18:18
Mike Nordell6-Sep-02 18:18 
GeneralRe: Very Large Files and CFile Pin
TyMatthews9-Sep-02 4:58
TyMatthews9-Sep-02 4:58 
GeneralRe: Very Large Files and CFile Pin
Mike Nordell11-Sep-02 23:27
Mike Nordell11-Sep-02 23:27 
GeneralRe: Very Large Files and CFile Pin
TyMatthews12-Sep-02 4:15
TyMatthews12-Sep-02 4:15 
Generalprinting file.html Pin
pnpfriend6-Sep-02 9:24
pnpfriend6-Sep-02 9:24 
GeneralRe: printing file.html Pin
Stephane Rodriguez.6-Sep-02 10:49
Stephane Rodriguez.6-Sep-02 10:49 
GeneralRe: printing file.html Pin
pnpfriend7-Sep-02 3:06
pnpfriend7-Sep-02 3:06 
Generalfprintf function Pin
Cintch6-Sep-02 8:23
Cintch6-Sep-02 8:23 
GeneralRe: fprintf function Pin
Joaquín M López Muñoz6-Sep-02 8:32
Joaquín M López Muñoz6-Sep-02 8:32 
GeneralRe: fprintf function Pin
sysop@HAL9K.com9-Sep-02 2:03
sysop@HAL9K.com9-Sep-02 2:03 
GeneralInternet Security Pin
Nick Parker6-Sep-02 8:12
protectorNick Parker6-Sep-02 8:12 
Questiondeclaration or define????? Pin
dand9996-Sep-02 8:02
dand9996-Sep-02 8:02 
AnswerRe: declaration or define????? Pin
l a u r e n6-Sep-02 8:11
l a u r e n6-Sep-02 8:11 
AnswerRe: declaration or define????? Pin
Joaquín M López Muñoz6-Sep-02 8:30
Joaquín M López Muñoz6-Sep-02 8:30 
AnswerRe: declaration or define????? Pin
[James Pullicino]6-Sep-02 9:10
[James Pullicino]6-Sep-02 9:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.