<commit_before>! (c)2010 <NAME> bsd license
USING: alien.c-types alien.data bootstrap.image
bootstrap.image.private destructors io io.directories
io.encodings.binary io.files locals system kernel ;
IN: tools.deploy.embed

:: embed-image ( image executable -- )
    executable binary <file-appender> [| out |
        out stream-tell :> offset
        image-path binary <file-reader> [| in |
            in out stream-copy*
        ] with-disposal
        image-magic uintptr_t <ref> out stream-write
        offset uintptr_t <ref> 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* ;<commit_msg>tools.deploy.embed: rename gone wrong. fixes #1415.<commit_after>! (c)2010 <NAME> bsd license
USING: alien.c-types alien.data bootstrap.image
bootstrap.image.private destructors io io.directories
io.encodings.binary io.files locals system kernel ;
IN: tools.deploy.embed

:: embed-image ( image executable -- )
    executable binary <file-appender> [| out |
        out stream-tell :> offset
        image binary <file-reader> [| in |
            in out stream-copy*
        ] with-disposal
        image-magic uintptr_t <ref> out stream-write
        offset uintptr_t <ref> 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* ;
{'fraction_non_alphanumeric': 0.11483550589695841, 'fraction_numerical': 0.0074487895716946, 'mean_word_length': 2.9221411192214113, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3502819', 'n_tokens_mistral': 519, 'n_tokens_neox': 487, 'n_words': 131}