Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 04.02.2004, 11:10   #1
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default Memory Mapped Files

I don't need to Map entire file but a portion of it (say, 1024 bytes).
And i want to read entire file, block by block, till the end.

Could anybody gimme a sample?
thanks in advance.
Reply With Quote
Old 04.02.2004, 11:14   #2
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 35
Posts: 21,717
Downloads: 2
Uploads: 0
Reputation: 250 | 7
Default

Задавай соответствующие параметры в MapViewOfFile.
Reply With Quote
Old 04.02.2004, 11:57   #3
Академик
 
greka's Avatar
 
Join Date: 09 2001
Location: inside myself
Posts: 5,369
Downloads: 0
Uploads: 0
Reputation: 18 | 5
Default

schital fayl, kusok mappirovannogo poodoshel k koncu - poluchayu error "can't read from file".

nujno sdelat' Unmap, potom: MapViewofFile (, , , newFileOffsetLow) ?
Reply With Quote
Old 04.02.2004, 13:36   #4
Грустно...
 
Agregat's Avatar
 
Join Date: 08 2002
Location: Там, где всегда идут дожди
Age: 35
Posts: 21,717
Downloads: 2
Uploads: 0
Reputation: 250 | 7
Default

Ну ты же знаешь размер сколько ты промаппил в память. Как прочел свои 1024 байта - снова Unmap/MapViewOfFile. Есть вариант два - пишешь свой маппер. Не будет так же эффективно, но пахать будет.
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 16:56.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.