4 ms·
For those wondering, the easiest way to do this is with: xxd -i filename.bin
by KMnO4 7y ago
For those wondering, the easiest way to do this is with:
xxd -i filename.bin
- dasyatidprime 7y agoYes, so long as you're willing to take a build-dep on vim. An od+awk+sed+sh combo will get you there from a POSIX base—and you have to add some wrapper text around the output of xxd anyway…
- anthk 7y agoxxd exists in standalone form. Compile it. https://github.com/ConorOG/xxd https://github.com/ConorOG/xxd
- dasyatidprime 7y agoI mean, so long as you're willing to take a build-dep on that, in that case.
- anthk 7y agoJust a c compiler.
- dasyatidprime 7y agoNo. So long as you're willing to take a build-dep on that code. Either you're expecting the code from that repository to exist somewhere in the compilation-host system already, or you are vendoring the code by copying it into your own repository and taking on any potential maintenance, unportability, any necessary configuration integration to make sure, for instance, that you're compiling for the host rather than the target in a cross-compile setup (did you make sure?)— Either way, if you use that code as part of your build process, you are taking a build-dep on that code. The fact that its only build-dep is a C compiler may play into making this a sensible choice as compared with something that has even more transitive dependencies, but it does not make it go away.
- rurban 7y agoToo bad that xxd doesn't include the const before the array decl. With const it saves a lot of memory.
- saagarjha 7y agoI don't see how const would save memory, unless you have a separate ROM region that keeps that out of the main memory.
- rurban 7y agoVMM. const memory can just be evicted and be swapped back in with zero cost. rw memory must be backed somehow, which us much more expensive. I submitted a patch
- AshamedCaptain 7y agoNot true unless you actively modify it (or the page it was in). "RW" mapped memory that is not dirty is also discarded on memory pressure.