Binding/merging files

Hi
I’m continuing a little “fun-project” for a friend.
Project is entirely made in Ruby, and therefore I was hoping this was
achievable within Ruby too.

Is it possible for Ruby to take 2 executables (.exe files) and bind them
together. I know there will be issues executing the files, but that is
not That important at this state. I’ve done quite some extensive
searching, but so far that hasn’t yielded anything useful.

Is this possible in Ruby?

File.open(‘combined.exe’, ‘w’) do |f|
f1 = File.read(‘prog1.exe’)
f2 = File.read(‘prog2.exe’)
f.write(f1 + f2)
end