From: David Douthitt Date: 2002-07-03T05:42:37+09:00 Subject: Re: Question: ruby vs. ksh This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. ----=_NextPart_ST_15_42_33_Tuesday_July_02_2002_17570 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable >>> hal9000@hypermetrics.com 7/2/02 12:28PM >>> ----- Original Message -----=20 From: "Massimiliano Mirra" To: "ruby-talk ML" Sent: Tuesday, July 02, 2002 12:19 PM Subject: Re: Question: ruby vs. ksh > recurse(dir) do |item| > File.delete(item) > end >=20 >=20 > Find.find is very similar, though it first visits directories and then > their content (preventing to delete directories), and does not change > the current dir. `find #{start} ! -type d`.each { |file| File.delete(file) } ksh again :-O =2E...Hal Fulton said: > It might also be good to have an iterator that only > visited directories. But I haven't thought that through. `find #{start} -type d`.each { |dir| .... } ksh yet again.... :-O ----=_NextPart_ST_15_42_33_Tuesday_July_02_2002_17570 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
>>> hal9000@hypermetrics.com 7/2/02 12:28PM >>>
-= ----=20 Original Message -----
From: "Massimiliano Mirra"=20 <list@NOSPAMchromatic-harp.com.web-hosting.com>
To: "ruby-talk ML"= =20 <ruby-talk@ruby-lang.org>
Sent: Tuesday, July 02, 2002 12:19=20 PM
Subject: Re: Question: ruby vs. ksh

> recurse(dir) do=20 |item|
>   File.delete(item)
> end
>
>
> Find.find is very similar, though it first visits directories and then
> their content (preventing to delete directories), and does not= =20 change
> the current dir.
 
`find #{start} ! -type d`.each { |file|
      File.delete(file)
      }
 
ksh again :-O
 
....Hal Fulton said:
 
> It might also be good to have an iterator that only
> visit= ed=20 directories. But I haven't thought that through.
 
`find #{start} -type d`.each { |dir|
     ....
     }
 
ksh yet again.... :-O
 
----=_NextPart_ST_15_42_33_Tuesday_July_02_2002_17570--