| | |
binary file manipulations
![]() |
>there're gotta be a better way ...
There isn't unless your system supports record-oriented files. Any solution will be a variation of what you were thinking of doing. Though naturally, any decent solution will take advantage of block reads and caching to avoid the performance hit of constantly reading and writing to disk.
vegaseat's suggestion is a good one for smaller files, but when working with multi-megabyte/gigabyte files, it's not practical to keep the entire file in memory at once. How you go about solving the problem depends on what files you expect and what kind of performance you're looking for.
There isn't unless your system supports record-oriented files. Any solution will be a variation of what you were thinking of doing. Though naturally, any decent solution will take advantage of block reads and caching to avoid the performance hit of constantly reading and writing to disk.
vegaseat's suggestion is a good one for smaller files, but when working with multi-megabyte/gigabyte files, it's not practical to keep the entire file in memory at once. How you go about solving the problem depends on what files you expect and what kind of performance you're looking for.
I'm here to prove you wrong.
![]() |
Similar Threads
- Binary File Parser (C++)
- Reading a Binary file using Visual Basic (Visual Basic 4 / 5 / 6)
- Reading a Binary File to a C++ Class (C++)
- C++ raster files (writing structs to a binary file) (C++)
Other Threads in the C Forum
- Previous Thread: encrypting...pls help me before 17 jan
- Next Thread: Variable Variable Names
| Thread Tools | Search this Thread |
#include * ansi array arrays asterisks binarysearch calculate centimeter changingto char character convert copyanyfile copyimagefile copypdffile creafecopyofanytypeoffileinc createprocess() database dynamic execv fflush fgets file floatingpointvalidation fork forloop function getlogicaldrivestrin givemetehcodez grade gtkwinlinux histogram homework i/o ide inches include infiniteloop input interest intmain() iso keyboard km license linked linkedlist linux list looping lowest matrix meter microsoft mysql number oddnumber open opendocumentformat openwebfoundation pdf pointer posix power probleminc process program programming pyramidusingturboccodes radix read recursion recv recvblocked research reversing scheduling segmentationfault send sequential single socket socketprogramming stack standard strchr string suggestions systemcall test threads turboc unix urboc user variable whythiscodecausesegmentationfault win32api windowsapi






