How can I copy a read-only file?

> Curt Hibbs wrote:
> > I've got a generic method that copies files. I

want

to preserve the
> > attributes of the source file in the destination
file. I started using this:
> >
> > require "ftools"
> > ...
> > File.copy(src_file, dest_dir)
> >
> > This works until I encounter a read-only file,

then

I get an exception:
> >
> > c:/ruby/lib/ruby/1.8/ftools.rb:23:in
`initialize':
> > Permission denied -
E:\Dev\RubyDev\rubyinstaller\c
> >
vs-repo\installer\stable/doc\DBD/ODBC-0.96/COPYING
> > (Errno::EACCES)
>

Perhaps you've repeated the copy and you already have

a

read-only
version in your dest directory which ftools is trying
to *write* to ??

Duh! That was it... This was being used in a makefile,
and it never occurred to me that this happenned after
the second time that I ran the makefile!

Thanks,
Curt

ยทยทยท

On Tue, 16 Mar 2004 16:04:34 +0900, "daz" wrote: