Comment

Comment by davidork

dunno about windows, but in llinux its fairly simple. I've had to do do this a lot of this sort of thing on big disk images my friend made with some weird program that pads the start of everything with 512 bytes of some random crap.

dd skip=10 iflag=skip_bytes if=original.file of=first10ktrimmed.file

despite being old, and the amount of insanely horrible things you can do when you mess up the syntax or mistype something using it, dd is fucking amazing.

to be fair, its not directly editing the file, but making a copy with the first 10k skipped.

you could have a jump/pointer that points to the shortened first block of the file and then at the end of that, a pointer/jump to pick up where the rest of the file continues, but you'd wind up with misalignment and fs fragmentation.

parent davidork 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton