VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Memory Mapped File Wrapper Class

by ULLI (93 Submissions)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 5.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (16 Votes)

A Memory Mapped File resides in virtual memory from the moment it is opened until it is closed.
This makes access to it very fast, in fact read and write merely consist of data moves in memory.
All parts of the file are accessible by means of a zero based offset and the length of
the data chunks you can transfer is only limited by the file size itself. The system will
swap out and in pages of virtual memory as necessary.
Only when you close the file the data are "lazily" written to disc, and the Physical
Write Operations are limited to the altered memory pages.
When you open an MMF you are required to supply an estimate of how large the file is gonna
be. Any reasonable estimate will be fine, however, you cannot exceed this estimate, ie you
can't extend a file while it is open, but you can truncate the file size to the actual
size used when you close it. You can extend an existing file by giving the appropriate
estimate when you open it and truncating it to the larger size when closing.
MMFs are byte oriented and that requires a bit of understanding the data types which VB uses
and how they are represented physically. The class contains tools however to handle the
different aspects.

API Declarations
a few...

Rate Memory Mapped File Wrapper Class

Download Memory Mapped File Wrapper Class

Download Memory Mapped File Wrapper Class (10 KB)

Memory Mapped File Wrapper Class Comments

No comments have been posted about Memory Mapped File Wrapper Class. Why not be the first to post a comment about Memory Mapped File Wrapper Class.

Post your comment

Subject:
Message:
0/1000 characters