From: Li Chen Date: 2006-10-23T06:29:55+09:00 Subject: Re: about file format Scott Barron wrote: > > As was said in another thread, you need to assemble the full path to the > file. > > Dir.foreach(path) do |file_name| > if File.file?(File.join(path, file_name)) > # ... > end > end Hi, Robert also privodes another solution one: ##### require 'find' path='I:/Common/xxx/Notebooks/Flow/OT1/OTI-4' file_number = 0 Find.find(path) do |f| puts f if File.file?(f) && f=~/\.\d+$/ # print out the file with format xxx.001 xxx.002... file__number+=1 end puts file_number -- Posted via http://www.ruby-forum.com/.