From: ahoward Date: 2003-02-01T00:46:13+09:00 Subject: Re: New to Ruby, would like a style critique - filedup.rb [0/1] On Sat, 1 Feb 2003, Douglas Hunter wrote: > ILikeFood wrote: > > I've just written my first Ruby application (all 135 lines of it) and > > being totally book educated, I would love for a more accomplished Ruby > > programmer just to look over and critique my work. > > > One of the reasons to follow Guy's advice and use "find.rb" is that it > wont recursively follow symlinks that point to a directory above. Your > code bails with "filedup.rb:62:in `open': Too many open files - "." > (Errno::EMFILE)" when given that test, while the find.rb code is not so > brittle. personally i prefer found = Dir['**/*'] over found = [] and Find.find ('.'){|e| found << e} it seems to work fine, following symlinks, recursing, etc. any drawbacks to this? assume you actually want a copy of found, rather tahn simply traversing the tree with a block. -a -- ==================================== | Ara Howard | NOAA Forecast Systems Laboratory | Information and Technology Services | Data Systems Group | R/FST 325 Broadway | Boulder, CO 80305-3328 | Email: ahoward@fsl.noaa.gov | Phone: 303-497-7238 | Fax: 303-497-7259 ====================================