Executable file containing data

I was thinking of a way to deploy configurations on a Linux system, specifically dotfiles.

I would really like to somehow compile all the point files into one executable file, which when deployed, expands them to the right place. Here's the tricky part: the files are not available on the system where the executable must be executed, and I only want to β€œsend” the executable. Nothing more.

Is there a way to put files in an executable so that they can be safely extracted later?

(I'm trying to build this in Haskell, but any language will do for POC.))

+6
source share
1 answer

You can do this using Template Haskell. Check out the file-embed package.

+8
source

Source: https://habr.com/ru/post/988376/


All Articles