I have a binary daemon that depends on another binary daemon at runtime to exist; I don't like this arrangement. (My code works on both OS X and Linux I say linux because I believe its okay to only assume
elf file formatting)
I knew about
xxd but thankfully found this post as well: How to dump a binary file as a C/C++ string literal? which uses
I was thinking that it ought to be possible to create arch specific obj files then at runtime do a match like so:
In pseudo OCaml
match arch with | Linux_32_bit -> write_to_file "/tmp/foo" "linux_bin_32"; Child_process.popen "/tmp/foo" | Darwin_64_bit -> ...
I was thinking that this on the face of it ought to work, assuming that the libraries that the embedded binary exist in the proper locations, other implementation details.
Is this even possible or a waste of time?