Using modern API for temp directory creation.
Using modern API for temp directory creation.

Using `FileManager.url(for:in:appropriateFor:create:)` will attempt to create an appropriate unique temporary directory for the archive URL (same volume). This may fail, however, (see http://openradar.appspot.com/50553219 ) so we fall back to using `NSTemporaryDirectory()` if we must.

Additionally, we defer a closure to remove the created temporary directory so it is properly cleaned up, even in an error situation.

NOTE:  As of macOS 10.12 `FileManager.temporaryDirectory: URL` is available and could be used in place of `NSTemporaryDirectory() -> String` when we are able to change our deployment target.

weichsel/ZIPFoundation,weichsel/ZIPFoundation