View in color | License | Download script | History | Other scripts by: bohdan |
30-Apr 11:08 UTC
[0.069] 11.478k
[0.069] 11.478k
autoextract.rREBOL [
Title: "Autoextracting REBOL file creator"
Date: 16-Jun-1999
File: %autoextract.r
Author: "Bohdan Lechnowsky"
Purpose: {Send files via email which can be decompressed simply by executing the contents of the message when it is received.}
Email: %bo--rebol--com
library: [
level: 'intermediate
platform: none
type: 'function
domain: [email file-handling]
tested-under: none
support: none
license: none
see-also: none
]
Version: 1.0.0
]
autoextract: func [
{Compresses a file and puts it into a script
which will automatically extract itself}
infile [file!] {Name of file to compress}
outfile [file!] {Name to save compressed file}
][
file: enbase/base compress read/binary infile 64
infile: to-file last parse infile "/"
output: [{Self-extracting REBOL-compressed file
REBOL [
Title: "Self-extracting compressed file"
Date: } now {
File: } mold infile {
Author: "Autoextract function by Bohdan Lechnowsky"
Comment: ^{
Simply run this script and it will
decompress and save the file for you
^}
]
if exists? } mold infile { [
print ["} infile { already exists, please rename"
" existing file and run again."]
halt
]
write } mold infile { decompress 64#} mold file
]
write outfile to-string reduce output
] Notes
|