Skip to content

Instantly share code, notes, and snippets.

Brendan Jurd direvus

Block or report user

Report or block direvus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kgn
kgn / ZipDir.py
Created Oct 5, 2010
Python function to zip up a directory and preserve any symlinks and empty directories.
View ZipDir.py
import os
import zipfile
def ZipDir(inputDir, outputZip):
'''Zip up a directory and preserve symlinks and empty directories'''
zipOut = zipfile.ZipFile(outputZip, 'w', compression=zipfile.ZIP_DEFLATED)
rootLen = len(os.path.dirname(inputDir))
def _ArchiveDirectory(parentDirectory):
contents = os.listdir(parentDirectory)
You can’t perform that action at this time.