From: Sebastian Hungerecker Date: 2007-03-11T01:07:55+09:00 Subject: Re: Find.find --- returns directories/files backwards Joseph Schiller wrote: > for some reason block processing is counter intuitive here > this code does not work > > e = Dir.open('/user/path/Documents') > e.entries.sort {|file| puts file } > => warning: multiple values for a block parameter (2 for 1) It doesn't work because you pass a block that accepts only one argument to sort. Any block passed to sort is supposed to take two arguments, compare these arguments and return -1, 0 or 1 depending on which argument is greater. What you apparenty want to do would be archieved by writing e.entries.sort.each {|file| puts file } thus passing the block to each and not to sort. -- Ist so, weil ist so Bleibt so, weil war so