From: drew Date: 2005-10-28T12:02:05+09:00 Subject: Re: Newbie help: File searching and writing output to new file OK - William, you were right - the Dir[*.log].each statement only returns a list of file names, not file handles, so I (and Daniel) was simply searching the filenames, which of course wasn't returning any results. So I tried William's command-line versions, and they work, but I would still like to know how to do the equivalent in a script. How do you convert a list of filenames into actual file handles so you can open them ? I guess I'll go and have a look in the Ruby docs. So thanks William, your solutions worked; and Daniel, you made some good suggestions (i.e. I was doing the wrong thing by zeroing the file every time I opened a new input file, and it was nicer to write directly to the file rather than into an array first), but you were caught by the same assumption as I made - that Dir.each gives you openable file handles, not just a directory listing ! Thanks guys, Drew