Click here to Skip to main content
15,907,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Directory Information Pin
Joe Woodbury7-Apr-04 18:13
professionalJoe Woodbury7-Apr-04 18:13 
GeneralAbout msdxm.ocx Pin
feiyanghu7-Apr-04 16:24
feiyanghu7-Apr-04 16:24 
GeneralFile Database Access Method Pin
IceBerG717-Apr-04 15:07
IceBerG717-Apr-04 15:07 
GeneralRe: File Database Access Method Pin
Joe Woodbury7-Apr-04 15:52
professionalJoe Woodbury7-Apr-04 15:52 
GeneralRe: File Database Access Method Pin
IceBerG717-Apr-04 16:26
IceBerG717-Apr-04 16:26 
GeneralRe: File Database Access Method Pin
Joe Woodbury7-Apr-04 18:01
professionalJoe Woodbury7-Apr-04 18:01 
GeneralRe: File Database Access Method Pin
IceBerG717-Apr-04 18:06
IceBerG717-Apr-04 18:06 
GeneralRe: File Database Access Method Pin
Joe Woodbury7-Apr-04 18:36
professionalJoe Woodbury7-Apr-04 18:36 
WriteFile is a low level call. It simply writes data to the disk. (The OS actually does some minor caching, but it's not significant.)

fwrite() writes data to an intermediate buffer (4k by default, I believe) when the buffer fills, the buffer is written to disk using a single call to WriteFile.

The same thing goes for reading data, only in reverse.

So, if you are reading/writing lots of smaller strings, you will get better performance with fread/fwrite unless you implement your own caching algorithm.

Note that you can get the original file handle by calling _fileno() with the proper FILE* and use that to call other functions directly (though doing any call that affects the file pointer (i.e. ReadFile, SetFilePointer, etc.) withough calling fflush first, will totally mess up the stream buffers.


Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke

GeneralFiltering OnFileOpen Pin
J Guds7-Apr-04 11:54
J Guds7-Apr-04 11:54 
GeneralRe: Filtering OnFileOpen Pin
valikac7-Apr-04 16:53
valikac7-Apr-04 16:53 
GeneralRe: Filtering OnFileOpen Pin
avenger_sb258-Apr-04 12:34
avenger_sb258-Apr-04 12:34 
GeneralGUI Pin
eldar_20017-Apr-04 11:36
eldar_20017-Apr-04 11:36 
GeneralRe: GUI Pin
valikac7-Apr-04 16:54
valikac7-Apr-04 16:54 
QuestionHow to write to a display that is not part of the desktop? Pin
Carla F.7-Apr-04 10:30
Carla F.7-Apr-04 10:30 
Generalgetlastinputinfo Pin
Anonymous7-Apr-04 10:13
Anonymous7-Apr-04 10:13 
GeneralRe: getlastinputinfo Pin
David Crow7-Apr-04 10:37
David Crow7-Apr-04 10:37 
GeneralRe: getlastinputinfo Pin
HAHAHA_NEXT7-Apr-04 10:42
HAHAHA_NEXT7-Apr-04 10:42 
GeneralRe: getlastinputinfo Pin
Michael Dunn7-Apr-04 13:11
sitebuilderMichael Dunn7-Apr-04 13:11 
GeneralHWND problem with ListControl Pin
krugger7-Apr-04 10:02
krugger7-Apr-04 10:02 
GeneralRe: HWND problem with ListControl Pin
Prakash Nadar7-Apr-04 15:35
Prakash Nadar7-Apr-04 15:35 
GeneralClearcase Users Pin
armentage7-Apr-04 10:00
armentage7-Apr-04 10:00 
GeneralRe: Clearcase Users Pin
David Crow7-Apr-04 10:40
David Crow7-Apr-04 10:40 
GeneralAbout BHO Pin
Anonymous7-Apr-04 9:23
Anonymous7-Apr-04 9:23 
GeneralRe: About BHO Pin
xxhimanshu7-Apr-04 19:51
xxhimanshu7-Apr-04 19:51 
QuestionUnable to declare a const static int vairable ??? Pin
HAHAHA_NEXT7-Apr-04 8:57
HAHAHA_NEXT7-Apr-04 8:57 

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.