Jump to content
  • Advertisement

Archived

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

redneckCoder

File I/O with the API

This topic is 5910 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

How do I do file I/O with Win32 API functions? I Googled and all I could find was DOS tutorials. Now correct me if I''m wrong, but DOS I/O function won''t work in the Windows environment right? Thanks. -AJ C:\DOS C:\DOS\RUN RUN\DOS\RUN -Comic Book Store Guy''s t-shirt that I saw on the Simpsons, although it didn''t actually come from the Simpsons. http://vdsoft.netfirms.com/home.html

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
why would you WANT to use the win32 api file functions?

Share this post


Link to post
Share on other sites
If by "DOS" you mean fopen and the such, they will work in Win32 since they most likely are implemented as Win32 calls anyway. But Win32 has so much more cool stuff you can do to the files! You need CreateFile, ReadFile, WriteFile and CloseHandle. Also check out the Ex versions of those functions, and CreateFileMapping, MapViewOfFile, and UnmapViewOfFile.

Share this post


Link to post
Share on other sites
Hey, I don't have a clue when it comes to file i/o in windows. Wanna try suggessting an alternative approach instead? I really would appreciate posts that would actually help me solve my problem. If you're not gonna help, why post? The least you could've done was criticize my choice of i/o method constructively. Anyone else care to give it a shot? Thanks.

-AJ

Edit: This was directed at Anonymous, not IndirectX

C:\DOS
C:\DOS\RUN
RUN\DOS\RUN

-Comic Book Store Guy's t-shirt that I saw on the Simpsons, although it didn't actually come from the Simpsons.

http://vdsoft.netfirms.com/home.html

[edited by - redneckCoder on April 17, 2002 12:41:06 AM]

Share this post


Link to post
Share on other sites
fopen, fread, fwrite, fputs, <fstream>, fprintf all should work in Win32. I thought you were looking for Win32 fun.

edit: HTML.

[edited by - IndirectX on April 17, 2002 12:44:20 AM]

Share this post


Link to post
Share on other sites
Never use any platform-specific API unless you have to. In other words, use fopen, fprintf, fwrite, and the rest, (include stdio.h in C or cstdio in C++) unless you have some good reason otherwise.

Share this post


Link to post
Share on other sites
quote:
Original post by merlin9x9
Never use any platform-specific API unless you have to.

Yeah, right. Try implementing file mapping objects or async io or completion ports in straight C++.

Share this post


Link to post
Share on other sites
quote:
Original post by IndirectX
Yeah, right. Try implementing file mapping objects or async io or completion ports in straight C++.

Did he say that the standard library could do everything? No. He said use the standard library for what it could do.

Share this post


Link to post
Share on other sites
quote:
Original post by IndirectX
Didn''t I list a bunch of standard library functions as well?

I fail to see what this has to do with what Merlin or I said.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!