in reply to pack/unpack binary editing
I'm looking at a 9 gig file and unpacking would result in 72 gigs.
There is absolutely no reason to convert your whole file into asciized binary.
You can access every bit in your file by using sysseek to position the read head and sysread to read a single byte or 4 bytes or 20.
You can then manipulate the bits of the bytes you read in using vec or boolean logic, or by unpacking to '0's & '1's if you prefer.
Once you have twiddled your bits, you can write them back by repositioning the file position with sysseek and write out the modified bytes using syswrite.
The only caveat is if you want delete or insert bytes--or worse, odd bits--, then you would have to do something a litte different. That is usually not the case though. Most file formats are at the very least byte aligned.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: pack/unpack binary editing
by nobull (Friar) on Feb 08, 2005 at 12:51 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2005 at 13:07 UTC | |
by blazar (Canon) on Feb 08, 2005 at 14:20 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2005 at 17:13 UTC | |
|
Re^2: pack/unpack binary editing
by tperdue (Sexton) on Feb 08, 2005 at 13:41 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2005 at 13:57 UTC | |
by tperdue (Sexton) on Feb 08, 2005 at 14:22 UTC | |
by BrowserUk (Patriarch) on Feb 08, 2005 at 17:04 UTC | |
by tperdue (Sexton) on Feb 10, 2005 at 12:40 UTC | |
| |
by samizdat (Vicar) on Feb 08, 2005 at 15:24 UTC |