Sunday, July 16, 2006

Windows FileMapping

Windows FileMapping (WinAPI)










Have you ever tried to access a file by chunks with BlockRead, BlockWrite? It works fine with types files but if you want to access files with different structures (read a byte at the position 300, an integer at the position 2999, a negative byte in the position 1000? All without the need to declare variables to intermediate these interchanges and without a file handle... is it possible? Yes!).

It is not hard to create complex files. Its enough to store more than one thing in a same place (it is very commom to have a file with different elements). For text only files, a header would solve but not for multimedia files (joining text, video, sound, graphics.. structures, raw data..). Using file of byte) does not give you easy access because does not release you from the work of declaring buffers to interchange data.

Immediate access in memory? Without variables? Use Windows Filemapping! And typecasting.

0 Comments:

Post a Comment

<< Home

Search in this blog:
Web DelphiEArte.blogspot.com
ip-location