Assorted tar related things, including a fast tar-based copy.
Project description
Assorted tar related things, including a fast tar-based copy.
Latest release 20260531: Update because an IterableQueue no longer has a .open() method.
My most heavily used use for this is my cpdir script which
does a high performance directory copy by piping 2 tars
together.
It runs this:
from cs.tarutils import traced_cpdir
sys.exit(traced_cpdir(*sys.argv[1:]))
Short summary:
tar: Tar up the contents ofsrcpathstooutput. Return thePopenobject for thetarcommand.traced_cpdir: Copy a directory to a new place using piped tars with progress reporting. Return0if both tars succeed, nonzero otherwise.traced_untar: Read tar data fromtarfdand extract. Return thetarexit code.
Module contents:
-
tar(*srcpaths: List[str], chdirpath='.', output, tar_exe='tar', bcount=2048): Tar up the contents ofsrcpathstooutput. Return thePopenobject for thetarcommand.Parameters:
srcpaths: source filesystem pathschdirpath: optional directory to which tochdirbefore accessingsrcpathstar_exe: optionaltarexecutable, default fromTAR_EXE:tarbcount: blocking factor in 512 byte unites, default fromDEFAULT_BCOUNT:2048
-
traced_cpdir(*a, upd: Optional[cs.upd.Upd] = <function uses_upd.<locals>.<lambda> at 0x10b0b7920>, **kw): Copy a directory to a new place using piped tars with progress reporting. Return0if both tars succeed, nonzero otherwise.Parameters:
srcdirpath: the source directory filesystem pathdstdirpath: the destination directory filesystem path, which must not already existlabel: optional label for the progress bartar_exe: optionaltarexecutable, default fromTAR_EXE:tarbcount: blocking factor in 512 byte unites, default fromDEFAULT_BCOUNT:2048
-
traced_untar(*a, upd: Optional[cs.upd.Upd] = <function uses_upd.<locals>.<lambda> at 0x10b0b7560>, **kw): Read tar data fromtarfdand extract. Return thetarexit code.Parameters:
tarfd: the source tar data, suitable forsubprocess.Popen'sstdinparameterchdirpath: optional directory to which tochdirbefore accessingsrcpathslabel: optional label for the progress bartar_exe: optionaltarexecutable, default fromTAR_EXE:tarbcount: blocking factor in 512 byte unites, default fromDEFAULT_BCOUNT:2048
Release Log
Release 20260531: Update because an IterableQueue no longer has a .open() method.
Release 20240318: Initial PyPI release with nice traced_cpdir() function.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cs_tarutils-20260531.tar.gz.
File metadata
- Download URL: cs_tarutils-20260531.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6855e4d5084e3512ab40a340b416d3b03bc19de9b02cd7996838b5fa2ff4e8e2
|
|
| MD5 |
aaf0d64217cb7596480b703d38887c18
|
|
| BLAKE2b-256 |
51f660503906a4f9dd46f71cbe883fb2791d0dc21d5c99cf6f3f65bb4efdc050
|
File details
Details for the file cs_tarutils-20260531-py2.py3-none-any.whl.
File metadata
- Download URL: cs_tarutils-20260531-py2.py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0890f523d479e2102f2d2ac02b4faa261a52a6e0640b89c947af6a4675bbcfa
|
|
| MD5 |
3348ad7090fc06d6f41bafa6a80e2854
|
|
| BLAKE2b-256 |
14b2b4983e60664cbdeb9b8b3139c838c44873057ae3037036c0495b5f60c820
|