Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: recursive directory copying...

From: Al:Bri:xtra at: 13-May-2003 19:26

tom wrote:
> I was just wondering if anyone has written a recursive directory copying
script. 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 [ Subdirectory: File foreach File read Directory/:Subdirectory [ append Files Subdirectory/:File ] ] ] ] Files ] ] Unpack: func [Pack [block!]][ parse Pack [ some [ set File file! set Data binary! ( make paren! [ write/binary File decompress Data ] ) | set File file! ( make paren! [make-dir/deep File] ) ] end ] ] Andrew Martin ICQ: 26227169 http://Valley.150m.com/