! Copyright (C) 2010 Joe Groff ! See http://factorcode.org/license.txt for BSD license. USING: alien.c-types alien.data bootstrap.image.private destructors io io.directories io.encodings.binary io.files kernel locals system ; IN: tools.deploy.embed :: embed-image ( image executable -- ) executable binary [| out | out stream-tell :> offset image binary [| in | in out stream-copy* ] with-disposal image-magic uintptr_t out stream-write offset uintptr_t out stream-write ] with-disposal ; : make-embedded-image* ( from-image from-executable to-executable -- ) swap [ copy-file ] keep embed-image ; : make-embedded-image ( from-image to-executable -- ) vm-path swap make-embedded-image* ;