Archived

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

File Manip in win32

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

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 on other sites
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 on other sites
I think C++ file stream I/O is the best, personally. I prefer it over _lread because it''s easier to use and is part of the C++ standard stream library.

Share on other sites
quote:
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?

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

// just make sure you include fstream.h then as followchar temp;ifstream filein( "blah.bla" );  // file inputofstream fileout( "blah.bla" ); // file outputfilein >> 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
A division of DLC Multimedia

Resist Windows XP''s Invasive Production Activation Technology!

"gitty up" -- Kramer

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

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

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

{ Stating the obvious never helped any situation !! }

1. 1
2. 2
3. 3
4. 4
Rutin
19
5. 5

• 14
• 14
• 9
• 9
• 9
• Forum Statistics

• Total Topics
632927
• Total Posts
3009253
• Who's Online (See full list)

There are no registered users currently online

×

Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!