Peter Bailey wrote:
> > This line:
> >>>     if /%!PS-Adobe/ =~ IO.open(file) {|f| f.gets}
> >
> > opens the file, gets the first line, closes the file, and checks the
> > line against the regex for a match.  If there is a match, this code
> >
> > executes:
> >>>       File.rename(file, file + ".eps")
> >>>     end
> >
> > That line renames the file.
> >
> > What more do you want to do?
>
> I want to rename the file(s), and, that's what's not working. I'm
> getting file permission errors.

The code posted above gives you permission errors? Or your original code gives 
you permission errors? Because the code posted above really shouldn't. If the 
code above gives you permission error, it's not because of open file handles.
Maybe you don't have permission to change the contents of the directory you
are working on?


-- 
Jabber: sepp2k / jabber.org
ICQ: 205544826