On 23 Aug 2007, at 12:54, Stefano Crocco wrote: > Alle gioved23 agosto 2007, Gabriel Dragffy ha scritto: >> Just another quicky, if I wanna rename all the files in the directory >> is what I did OK, using: >> next if f=="." or f==".." >> >> I just feel there must a better way? > > If you want to rename only files, then you should do > > next unless File.file? f > > This way, you skip not only the given directory and its parent, but > also any > directory inside the current. If you're sure the given directory > contains > only files, then you're approach and mine should be equivalent > (although, in > my opinion, mine makes clearer why you're skipping those entries). > > Stefano > Aha yes, perhaps in my situation both equal, but yours is surely cleaner and in another situation it would save me from nuking the subdirs. Thank you, Stefano.