can tarfile maintain directory structure?

Jay Donnell jaydonnell at
Wed Aug 18 01:08:42 CEST 2004

Is there a way to use the tarfile module to recursively compress the
contents of a directory and maintain the directory structure in the
tar archive?

Simply doing os.system('tar -czvf ' + fileName +'.tar.gz ' +
 works great on linux, but I need this script to work on windows as
well :(

More information about the Python-list mailing list