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

[REBOL] Deltree + Xcopy

From: bttai::yahoo::fr at: 29-May-2002 19:19

___________________________________________________________ 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: [allenk--powerup--com--au] 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] ]