开发者

Treat file as memory block in C

Is there any way to make pointers read a file as a blo开发者_JAVA技巧ck of memory in C? Can access of a file can be faster...?


Treating a file as memory (and letting the OS do the file IO for you) is termed 'memory mapping'.

On POSIX (e.g. Linux), the mmap() function does this.

On Windows, the OpenFileMapping() function and friends do this. Microsoft have excellent description of how this works, why to use it, and particulars on their platform here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜