From: forgottenwizard Date: 2007-10-22T05:56:23+09:00 Subject: Re: Problem using FileUtils to sort JPEG files On 03:05 Mon 22 Oct , William James wrote: > On Oct 20, 11:12 pm, forgottenwizard > wrote: > > This is an odd problem, I admit. I'm currently working on a short script > > to sort a set of JPEGs by size, but right now I'm just trying to move > > them from point A to point B (I'm still learning Ruby, so I do this to > > try and figure things out before getting into the big stuff), and so far > > I have gotten so far as: > > > > ####################CODE#################### > > > > #!/usr/bin/ruby -wd > > > > require "RMagick" > > require "fileutils" > > > > Dir.chdir(ARGV[0]) > > > > for pix in Dir.glob("*.{jpeg,jpg,png}") > > filetype = Magick::Image::read(pix).first.format > > workdir = Dir.pwd > > If File.directory?(filetype) then > > Are you telling us that this is the exact code that you > ran? It can't be. Ruby is case-sensitive. It's "if", > not "If". How did "If" get into this code? Didn't you > copy and paste? Or did you retype it? Retyped it. uxterm doesn't like copy+paste.