___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

-- Attached file included as plaintext by Listar --
-- File: Xcopy.r
-- Desc: Xcopy.r

REBOL []
xcopy: func [src [file! url!] dest [file! url!]] [
        either dir? src [
                make-dir/deep src
                foreach file read src [
                        either dir? src/:file [
                                make-dir/deep dest/:file
                                subsrc: to-file join src file 
                                subdest: to-file join  dest file
                                xcopy subsrc subdest
                        ][
                                write/binary  dest/:file read/binary src/:file 
                        ]
                ]
        ][
                        write/binary  dest read/binary src 
        ]
]
xcopy %outil/ %outil1/

-- Attached file included as plaintext by Listar --
-- File: delete-dir.r
-- Desc: delete-dir.r

REBOL [
 Title: "delete-dir function"
 Author: "Allen Kamp"
 Date: 22-Jul-1999
 File: %delete-dir.r
 Email: [EMAIL PROTECTED]
 Purpose: {A simple delete directory & all its contents function}
 Category: [File]
]

delete-dir: func [
 {Delete directory and its contents, including read-only files. Use with
caution}
 directory [file! url!] {The directory to delete}
 /local file
][
 foreach file read directory [
  either not dir? directory/:file [
   if error? try [delete directory/:file][
    ;---File is probably read only, so change its access to write
    try [write/binary/allow directory/:file "" [write]]
    try [delete directory/:file]
     ]
  ][
  ;--Recurse
  delete-dir directory/:file
  ]
 ]
 try [delete directory]
]




-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to