[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sv: Sv: Sv: PenguinFile
"Bjarke Hammersholt Roune" <asmild@post6.tele.dk> on 14/07/99 09:07:12
Please respond to penguinplay@sunsite.auc.dk
To: penguinplay@sunsite.auc.dk
cc: (bcc: Peter Burns/First Data Resources/AU)
Subject: Sv: Sv: Sv: PenguinFile
>>Hmm, I think I'll use memory mapping for this (as well as Pak directory
>>reading) - that amounts about to the same (and, as it is directly
supported
>>by the OS it's faster). Can you check if Win32 also supports memory
mapping
>>(IIRC I sent you the description of mmap() with the POSIX stuff)?
>>
>Win32 does not support this. Not to my knowledge. However, if you
implement
>it something like this: (the name and return type of course doesn't
matter;
>just the way of specifying which files gets mmap).
>It should be possible to implement it in Win32. This might get pretty
messy
>if not well thougth out, though. We'd have to talk a bit about this, then.
>Every filehandling function in PenguinFile would have to have special
>support for this. On the positive side is that this might be an extra
>inticement for Win32 developers to use PenguinFile.
>I'll ask around if Win32 REALLY doesn't support file caching. I want to be
>VERY sure of this before implementing it... :)
>At this point, the version of mmap() I've implemented always fails, and
the
>version of unmmap() I've implemented always succeds. It's a bad hack, but
it
>should work for most porpuses (even for those who don't check their return
>values).
Look up File Mapping in msdn. Win32 doesn't have mmap but it can map files
into memory. I don't know the exact details of how to do it but it involves
CreateFile, CreateFileMapping, MapViewOfFile, then when you've finished
UnmapViewOfFile and CloseHandle.
Peter Burns