Sign in to follow this  
MrJoshL

Pointers To Appendage Of File?

Recommended Posts

Is there a way to point to a certain part of a very large file (>1 gigabyte)?

 

My intention is to store every game asset in a database. My way of doing that is just to write a file that may be a little bit bigger than a gigabyte, but still holding everything like a database. Is there a way to quickly point to a certain entry in the database, rather than doing a search every time I need to pull something?

 

EDIT: I do know that there is a WinAPI function for file pointers than can be changed to an offset of 5 bytes, but is there an easier way, preferably with the standard library?

Edited by MrJoshL

Share this post


Link to post
Share on other sites

Windows file cursors are internally 64-bit, so it is easy to access more than 1 gb. On 32-bit systems, you cannot directly map more than 4gb into your process address space - of course - because the pointers are 32-bit. You can still seek, read and write normally, though. It is also possible to map different regions of the file, if it is larger than the available address space.

Edited by Nik02

Share this post


Link to post
Share on other sites

That's a very reasonable size for a commercial, locally-installable game. Most recent games on the market are way larger due to content size. Of course, for web-based gaming and/or distribution, smaller is usually better.

Edited by Nik02

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this