• Advertisement

Archived

This topic is now archived and is closed to further replies.

File Manip in win32

This topic is 5994 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

whats the best (and preferably easiest) way to do file i/o in a win32 app? i have used fstream in dos, and it works in win32, but i don''t know if there is a *better* way to do it. i was reading up on the changes from c to c++, and one of them was updating the old streams (printf, fstream, etc). could someone clear me up? the madprogrammer

Share this post


Link to post
Share on other sites
Advertisement
Just use the standard C or C++ i/o libraries. They work fine, and they require less OS specific code, which is always a plus. I use the C i/o libraries in every program I write, regardless of it''s OS or design philosophy (modular, object oriented, et cetera).

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post


Link to post
Share on other sites
quote:
Original post by MadProgrammer
whats the best (and preferably easiest) way to do file i/o in a win32 app? i have used fstream in dos, and it works in win32, but i don''t know if there is a *better* way to do it. i was reading up on the changes from c to c++, and one of them was updating the old streams (printf, fstream, etc). could someone clear me up?

the madprogrammer


All you need to do the simplest file manip in win32 is


// just make sure you include fstream.h then as follow
char temp;

ifstream filein( "blah.bla" ); // file input
ofstream fileout( "blah.bla" ); // file output

filein >> temp;
fileout << temp;


Now, to me, that''s the easiest way to do file I/O manips... hope this helps you out.


"And that''s the bottom line cause I said so!"

Cyberdrek
Headhunter Soft
A division of DLC Multimedia

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer

Share this post


Link to post
Share on other sites
well, the win32 way has more features than the
simple IO

CreateFile()
ReadFile()
WriteFile()
CloseHandle()
GetFileSize();
SetFilePointer();

check them out, its quite simple to use
and fast..


{ Stating the obvious never helped any situation !! }

Share this post


Link to post
Share on other sites

  • Advertisement