From: David Masover Date: 2010-10-17T00:51:25+09:00 Subject: Re: Most elegant way: array of files from array of directories On Saturday, October 16, 2010 05:00:10 am Robert Klemme wrote: > On 16.10.2010 06:50, Terry Michaels wrote: > > I have a array of directories passed into my program. I want a new array > > which is a list of all files in said directories (only one level deep is > > necessary). N.B.: > > > > 1. Each elements of the new array must be an absolute (full) path, or at > > least relative to the cwd. (Assume all directories provided are also > > absolute or relative to cwd) > > 2. OS and preference agnostic: Especially, I do not know what directory > > separator will be used (say, backward- or forward-slash) or whether > > there will be a trailing directory separator in the directory path (say, > > a trailing forward-slash). > > You can always use a forward slash in Ruby. Also worth mentioning: I don't know of any OSes Ruby supports which don't also support a forward Slash. For example, while Windows typically uses backslashes, it also supports forward slashes.