thanks guys, I didn't get to try the solution until I got back from traveling, It worked nicely, I used Dir["*.gif"] instead and it worked thanks bashar On Thursday 27 December 2001 14:48, you wrote: > >>>>> "B" == Bashar A Asad <baasad / qualitynet.net> writes: > > B> n = no_ext(f) > > You remove the suffix '.gif' to `f' and store the result in `n' > > B> img.write("filename"=>f+"thumb.gif") > ^ > but here you re-use `f' and not `n' > > B> end > > B> Dir.foreach(dir){|file| > B> createThumbFile(file) > B> } > B> and didn't work, the error message below > B> ----------------------------------------------------------------- > B> /usr/lib/ruby/1.6/magick.rb:63: warning: Unable to open file: . (330) > ^^^ > > Dir#foreach give all entries : this mean that you have `.' (current > directory) and `..'. You must filter these entries (with a test) or use > Dir::glob to have only the filenames that you want > > > Guy Decoux