Click here to Skip to main content
15,912,897 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Fast files Pin
David Crow9-Nov-05 10:40
David Crow9-Nov-05 10:40 
GeneralRe: Fast files Pin
hint_549-Nov-05 10:51
hint_549-Nov-05 10:51 
GeneralRe: Fast files Pin
kakan9-Nov-05 20:36
professionalkakan9-Nov-05 20:36 
GeneralRe: Fast files Pin
hint_5410-Nov-05 8:59
hint_5410-Nov-05 8:59 
GeneralRe: Fast files Pin
kakan10-Nov-05 19:50
professionalkakan10-Nov-05 19:50 
AnswerRe: Fast files Pin
kakan9-Nov-05 20:51
professionalkakan9-Nov-05 20:51 
GeneralRe: Fast files Pin
hint_5410-Nov-05 9:30
hint_5410-Nov-05 9:30 
GeneralRe: Fast files Pin
kakan10-Nov-05 19:41
professionalkakan10-Nov-05 19:41 
Hello and good morning.

About the stack check, here is a snippet:

#pragma check_stack(off)
/* Funcs that are called often... */
char * _fastcall CWrTapeTh::w32fgets(char *string, int n)
{
....
}
#pragma check_stack(on)

The 4 GB limitation applies to all the old file handling funcs, bot the f-funcs (fopen, fwrite, ...) and open, write.
The reason for this limitation is a 32-bit value (unsigned long, I think), that holds the actual position in the file. And that counter wraps at (approx) 4 GB.

The Win32-funcs doesn't have that limit of file size.
Which one is fastest? To be honest, I don't know, really. But the Win32-funcs are the only way to go if you want to be able to handle files of any size.
My guess is that the Win32-funcs can be really fast.

Besides, (as I said in my earlier post), the Win32-funcs can use overlapped I/O, which means that you can have several read/writes going on at the same time.

Just try to write a file to a diskette with the f-funcs. Get the time for it.
Then write the same file to the hard drive. Now, copy that file to the diskette. Get the time for the copy. Compare the times. You will see a remarkable difference. Why?
I'm not 100% sure, but my guess is that Windows copy uses overlapped I/O.

I know there is samples of overlapped file I/O at MSDN.
Maybe I should dig deeper in this and post an article at CP? Smile | :)

Kakan


QuestionGantt chart Pin
ppp0019-Nov-05 7:01
ppp0019-Nov-05 7:01 
QuestionGantt chart component Pin
ppp0019-Nov-05 6:59
ppp0019-Nov-05 6:59 
AnswerRe: Gantt chart component Pin
hint_549-Nov-05 7:31
hint_549-Nov-05 7:31 
AnswerRe: Gantt chart component Pin
David Crow9-Nov-05 8:38
David Crow9-Nov-05 8:38 
QuestionCString concatenation Pin
Kharfax9-Nov-05 6:31
Kharfax9-Nov-05 6:31 
AnswerRe: CString concatenation Pin
Maximilien9-Nov-05 6:47
Maximilien9-Nov-05 6:47 
AnswerRe: CString concatenation Pin
RChin9-Nov-05 6:50
RChin9-Nov-05 6:50 
GeneralRe: CString concatenation Pin
Kharfax9-Nov-05 6:55
Kharfax9-Nov-05 6:55 
AnswerRe: CString concatenation Pin
James R. Twine9-Nov-05 6:57
James R. Twine9-Nov-05 6:57 
QuestionLoss of "Called by"-functionality Pin
Polly Parrot9-Nov-05 5:02
Polly Parrot9-Nov-05 5:02 
QuestionJava problem in hosted IE view... Pin
James R. Twine9-Nov-05 4:08
James R. Twine9-Nov-05 4:08 
QuestionVC6.0 and VS.NET co-existence question Pin
prcarp9-Nov-05 3:20
prcarp9-Nov-05 3:20 
AnswerRe: VC6.0 and VS.NET co-existence question Pin
John M. Drescher9-Nov-05 3:58
John M. Drescher9-Nov-05 3:58 
QuestionGDI+: Image Save returned Invalid Parameter Pin
raed9-Nov-05 3:13
raed9-Nov-05 3:13 
QuestionMenu items grayed out? Pin
Jesper Knudsen9-Nov-05 2:44
Jesper Knudsen9-Nov-05 2:44 
QuestionRe: Menu items grayed out? Pin
David Crow9-Nov-05 3:05
David Crow9-Nov-05 3:05 
AnswerRe: Menu items grayed out? Pin
Jesper Knudsen9-Nov-05 3:25
Jesper Knudsen9-Nov-05 3:25 

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.