* William James <w_a_x_man / yahoo.com> (22:01) schrieb:

>>| File.rename(file, "#{file}.eps") if /%!PS-Adobe/ =~ File.open {|file| f.gets}
>
> I think that should be
>
> File.rename(file, "#{file}.eps") if /%!PS-Adobe/ =~ File.open(file){|
> f| f.gets}

Yeah, I correct one error and repeat another.

> More terse:
>
> File.rename(file, "#{file}.eps") if /%!PS-Adobe/ =~ IO.read(file,10)

That's a violation of the DRY principle.

Define PS = '%!PS-Adobe' then

| File.rename(file, "#{file}.eps") if IO.read(file, PS.length)[PS]

mfg,                 simon .... l