From: itsme213 Date: 2004-12-22T08:12:01+09:00 Subject: Re: FileUtils.cp_r - how to prune Ok, this was not as messy or as complicated as I thought ... once I figured out how to avoid getting into absolute pathnames for Find.find. I did: Dir.chdir(an_absolute_path) do # block executed with process directory set Find.find(".") do |f| # now I can work with relative paths Find.prune if f =~ /.svn/ target = File.join(target_dir, f) # easy with relative paths # either FileUtils.mkdir(target) or FileUtils.cp(f,target) end end Thanks for the suggestions. "Andrew Johnson" wrote in message news:tkixd.524094$Pl.259735@pd7tw1no... > On Sun, 19 Dec 2004 04:35:26 GMT, itsme213 wrote: > > Thanks, I'll keep that as a backup. But I should have been more explicit .... > > > >> > I am doing > >> > FileUtils.cp_r( "source/.", "generated") > >> > to copy a directory tree. > >> > > >> > How can I prune out any sub_tree with /.svn/ ? > > > > How can I prune out any sub_tree with /.svn/ in its path from even being > > copied over in the first place? > > The easiest way is probably just to modify FileUtils.cp_r() to add an > ":ignore => %r{}" option (and adjust fu_copy_dir() accordingly). A quick > glance looks like only a handful of lines would be affected/added. > > andrew > > -- > Andrew L. Johnson http://www.siaris.net/ > It's kinda hard trying to remember Perl syntax *and* Occam's > razor at the same time :-) > -- Graham Patterson