Memory Mapped File Access

div0 div0 at users.sourceforge.net
Sat May 29 05:36:27 PDT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert wrote:
> On 2010-05-28 23:41:46 +0200, Robert <robert.muench at robertmuench.de> said:
> 
>> 1. How can I expand the size of a MMF after it was created?
> 
> Replying to myself: Simple, close the file, and re-open with new size.
> Old content is kept. This should be added to the docs, as it's not
> totally clear.
> 
>> 2. If I specify 100GB file-size will it always be written once to disk
>> even if there is nothing in it? Or does the OS use sparse-files as well?
> 
> Current things I found out: Filesize is used as soon as things are
> flushed to disk. So MMF need to grow in chunks to be real useful.
> 
> -- 
> Robert M. Münch
> http://www.robertmuench.de
> 

NTFS supports sparse files:

http://msdn.microsoft.com/en-us/library/aa365566(v=VS.85).aspx

Not sure how you're going to get that to play with phobos memory mapped
file. I'm guessing you'd be better off writing your own accessor so you
can explicitly support each target platform.

- --
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFMAQpLT9LetA9XoXwRAlD/AKDLkw+FHiLCaTGz8oSBzgTKCZFf4ACg0Uyg
CHTCPA6RL4vGMq3JVJad/Hk=
=Lz1M
-----END PGP SIGNATURE-----


More information about the Digitalmars-d mailing list