-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement streaming zipfile creation for sending directories
Instead of creating a temporary zip file on disk to send when transferring a directory, this commit uses the zipstream-ng library to generate the zip file on the fly. This results in no disk usage, a much shorter startup time, and minimal memory usage. For adding files to the stream from the directory, the `walk` function the `zipstream-ng` package provides was used since it preserves empty directories as well as follows symlinks. Since files aren't actually read until they're about to be transferred, an `os.access` check is done to make sure that unreadable files are not added to the stream (which would cause it to crash mid-transfer).
- Loading branch information
Showing
3 changed files
with
41 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters