From: Nobuyoshi Nakada Date: 2007-08-13T11:37:50+09:00 Subject: Re: Removing file names with '.' in their names from list? Hi, At Mon, 13 Aug 2007 07:16:49 +0900, Sfdesigner Sfdesigner wrote in [ruby-talk:264328]: > Currently I'm using this code to output a list of files to a .rhtml > page: > > <% > Dir.foreach("/") do |file| > next if File.fnmatch('*.*', file) > puts '' + file + '' > end > %> > > This removes files from the list output such as 'photo.jpg'. > > But it leaves the files with names like '.htaccess', ',' and '..'. File.fnmatch('*.*', file, File::FNM_DOTMATCH) -- Nobu Nakada