in reply to Re^2: how to copy source folder excluding specific set of sub folder from parent folder
in thread how to copy source folder excluding specific set of sub folder from parent folder

Hi,

soonix already pointed out the issue around . and .. directory traversals. You'll need to keep track of visited directories to avoid looping over them again. There's also one more path that you can look into:

$searchfile =~ /^\.svn$/; print "$searchfile\n"; rmdir $searchfile; if ( -d $searchfile) { &traversedir($searchfile); } else { last; }

Now, this is not necessarily a problem - but you are not really checking for .svn folders, merely matching and overwriting the $searchfile variable. What do you think would happen if there were no match? :-)

That said, what's wrong with just doing svn export $srcFolder $targetFolder? It doesn't look like you're doing it as an exercise (those vhdl, rtl, sim folders?) If you have svn installed, you already have this tool at your disposal. Why reinvent the wheel? :-)

  • Comment on Re^3: how to copy source folder excluding specific set of sub folder from parent folder
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: how to copy source folder excluding specific set of sub folder from parent folder
by soonix (Chancellor) on Aug 14, 2016 at 09:58 UTC
    But he would have to be concerned about "ignored" files, wouldn't he?
      Well, if all his "ignored" files were about svn metadata folders and files(.svn folders), why would he need to reimplement svn export?
        I meant those ignored via svn propedit svn:ignore (e.g. Blobs that are supposed to stay unchanged)