William James
7/29/2007 12:45:00 AM
On Jul 28, 6:58 pm, Gavin Sinclair <gsincl...@gmail.com> wrote:
> On Jul 29, 8:24 am, Jon Dale <jdal...@yahoo.com> wrote:
>
> > >> files.each do |f|
> > >> next if f == "." or f == ".."
> > >> FileUtils.copy(dir,newdir)
>
> > > You forgot to use f in this line.
>
> > Isn't the f covered in the do statement? I'm not sure how else f would
> > be implemented.
>
> FileUtils.copy(f, newdir)
Or
FileUtils.copy( "#{dir}/#{f}", newdir)
FileUtils.copy isn't a mind-reader.
It doesn't know (or assume) that you have put
the name of the file in variable named f.
It doesn't know that it is being invoked
inside of a loop.