apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barrie Green" <barrie.gr...@gmail.com>
Subject using/creating memory mapped files for writing.
Date Wed, 15 Aug 2007 12:49:13 GMT
Hi all,

I would like to be able to create a memory mapped file and write to
it, then after a time save it to disk, but I can't work out the
correct combination of flags/calls to get it to work.

if I create a file like so:

ok=apr_file_open(&fp, filename, APR_FOPEN_WRITE|APR_FOPEN_CREATE,

I can't get apr_mmap_create to succeed: With

ok=apr_mmap_create(&mmap, fp, 0, 0, APR_MMAP_WRITE, APR_POOL());

I get 22 returned which according to apr_strerror is "Invalid
Argument". If I change the siize arg to something else, 512 eg, I get
"Acess denied" - which I is correct I suppose as the file doesn't have
a size as I've just created it.

Whats the correct way of doing this? Or is it not possible?

I'm on WindowsXP and I have admin privs.

Many thanks.


View raw message