Re: Adding/Removing byes from the beginning of a file

new topic     » goto parent     » topic index » view thread      » older message » newer message
GreenEuphorian said...

How to add/remove bytes from the beginning of a (binary) file?

You have to create a new file based on copying the original file, adding bytes or not copying bytes as required.

Sorry but there is no easy way out of this. Doing low-level filesystem manipulation is bound to be messy and dangerous; definitely not worth the effort.

If running on Windows, you could open the file in update mode, copying bytes from later locations to earlier locations (means remembering and setting current file position) and then when you have finished that, calling the API routine SetEndOfFile() in the kernel.dll.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu