unknown wrote: > On Thu, 28 Sep 2006, Peter Bailey wrote: > >>>> Dir.glob("*.ps").each do |psfile| >>> the modification is question >>> >>> -a >> >> >> Thanks. I ended the scan block before doing any file writing. That >> seemed to do the trick. It still confuses me, though, because, this code >> was borrowed from an existing script that I've been using for 6 months, >> and, that part of it is just as you see it above. > > probably because totalpages is always 1 - it's never even - in your new > script > the number of pages is always 2 (or 0) i'm guessing, and so the bug is > triggered. if i we're you i'd update the other script - it's a bug in > waiting. > > regards. > > -a Well, I know that they're not always odd or even. They've been a mix of both. But, I understand what you're saying. I will change my original script. Basically, and, please tell me if I understand this correctly: if I'm going to do a scan of a file, open the file, scan it, and then close it. Right? -- Posted via http://www.ruby-forum.com/.