Jump to content
  • Advertisement

Archived

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

d000hg

Behaviour of fopen()

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

When I call fopen(...) what actually happens - does the file get read into memory or what? If I try to open a 2GB file will it succeed in <1s or take hours? Similarly is it any speed change with fseek whether you go 10bytes or 10Gbytew into the file?
Read about my game, project #1 NEW (18th December)2 new screenshots, one from the engine and one from the level editor
John 3:16

Share this post


Link to post
Share on other sites
Advertisement
it''s implementation dependent - the c specification doesn''t say anything about what actually happens.

Share this post


Link to post
Share on other sites
Most of this is implementation-defined, but any reasonable stdio implemementation can be expected to buffer none or relatively little of the file contents when you call fopen. While there's no guarantee, file size is very unlikely to affect the performance of fopen in any significant way.

If you specifically want to know what the MSVC run time library does, you can take a look at the source code (it's available on your MSVC disc).


[edited by - spock on January 31, 2003 6:55:20 AM]

Share this post


Link to post
Share on other sites
I don''t have a 10Gb file to open! I guess I could try fwriting loads of random junk and see if it locked up...



Read about my game, project #1
NEW (18th December)2 new screenshots, one from the engine and one from the level editor



John 3:16

Share this post


Link to post
Share on other sites
quote:
Original post by civguy
[offtopic]
And can''t you make that signature smaller? With non-bold text?
[/offtopic]


[offtopic]
why worry about people''s sig ?
[/offtopic]

Share this post


Link to post
Share on other sites
quote:
Original post by Metal Typhoon
[offtopic]
why worry about people''s sig ?
[/offtopic]
[offtopic]
They needlessly gather attention (especially those with images/big font), even though they usually have no useful content.
[/offtopic]

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.

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!