[REBOL] Re: recursive directory copying...
From: Al:Bri:xtra at: 13-May-2003 19:26
> I was just wondering if anyone has written a recursive directory copying
These two functions do the job for me. 'Recursive-read generates a block of
directories and file names, another function not shown here inserts
'compress-ed data, then 'Unpack decompresses data, writes file and makes a
directory as required.
Recursive-Read: function [
"Recursively read Directory."
Directory [file! url!] "The Directory to read."
] [Files Subdirectory] [
if exists? Directory [
Files: read Directory
if block? Files [
foreach File Files [
if #"/" = last File [
foreach File read Directory/:Subdirectory [
append Files Subdirectory/:File
Unpack: func [Pack [block!]][
parse Pack [
set File file! set Data binary! (
make paren! [
write/binary File decompress Data
| set File file! (
make paren! [make-dir/deep File]
ICQ: 26227169 http://Valley.150m.com/