python copytree with negated ignore pattern

Posted by Chris H on Stack Overflow See other posts from Stack Overflow or by Chris H
Published on 2010-05-12T18:44:51Z Indexed on 2010/05/12 19:04 UTC
Read the original article Hit count: 133

Filed under:
|

I'm trying to use python to copy a tree of files/directories.

is it possible to use copytree to copy everything that ends in foo?

There is an ignore_patterns patterns function, can I give it a negated regular expression? Are they supported in python?

eg.

copytree(src, dest, False, ignore_pattern('!*.foo')) Where ! means NOT anything that ends in foo. thanks.

© Stack Overflow or respective owner

Related posts about python

Related posts about regex