can tarfile maintain directory structure?

Jay Donnell jaydonnell at yahoo.com
Tue Aug 17 19:08:42 EDT 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 ' +
directory)
 works great on linux, but I need this script to work on windows as
well :(



More information about the Python-list mailing list