From: Paul Lutus Date: 2006-10-23T08:45:10+09:00 Subject: Re: What is wrong with my code Li Chen wrote: / ... > Thank you very much for the code. Based on what I understand and what I > need I make some changes. But I still have some questions:1) How do I > factor the print or format codes here? Tell me what output you want to see and I will tell you how to get it. > 2) The outputs of the file are > in reverse order how do I print them out in this format; xxx.001, > xxx.002,...,xxx.026 Push the items into an array, sort the array, print the sorted array. > 3) what is the purpose of File.basename here? File.basename gives either a filename without its preceding path, or a filename without either its preceding path or its suffix, depending on which options are exercised. Because of the nature of your questions, I want to make you aware of a way to get some answers on your own: http://www.ruby-doc.org/ ... and ... http://www.ruby-doc.org/docs/ProgrammingRuby/ The second of these, which can also be downloaded, is a treasure trove of information. It contains answers to a large percentage of your questions. -- Paul Lutus http://www.arachnoid.com