Hi Andrew,
Looks good. One point.
My experience has been that when using the dir? function on an FTP target it
will access the target causing a network read each time you use it - which
is entirely reasonable because it represents the question "is this a
directory?".
In my code I posted earlier, I use something like this test instead:
dirized?: func [f][equal? f dirize f]
The reason I do so, is that having got the results of READ on a directory -
rebol has told me which are directories - they are the ones with the / at
the end. Well, it seems to work... :)
Thus saving heaps of network activity.
Brett Handley.
----- Original Message -----
From: "Andrew Martin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 23, 2001 6:33 PM
Subject: [REBOL] Re: Recursive directory read/delete
> Andrew Martin wrote:
> > Anyone got a recursive directory deleter written?
>
> Thanks everyone for their solutions. They were very helpful. Here's my
> solution to the problem:
>
> Delete!: make object! [
> _Delete: get 'delete
> set 'Delete func [
> "Deletes the specified file(s)."
> Target [file! url!] "The file to delete."
> /Any "Allow wild cards."
> ][
> if exists? Target [
> either Any [
> _Delete/any Target
> ][
> if dir? Target [
> foreach File read Target [
> Delete Target/:File
> ]
> ]
> _Delete Target
> ]
> ]
> none
> ]
> ]
>
> Andrew Martin
> ICQ: 26227169 http://members.nbci.com/AndrewMartin/
> -><-
>
>
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.