tarfile
Tar is a traditional archive format used on Unix-like systems to collect multiple files and directories into a single file. A tar archive preserves file metadata such as permissions, ownership, modification times, and directory structure, but does not compress data by itself. To reduce size, tar archives are commonly compressed with external programs, producing files with extensions such as .tar.gz or .tgz (gzip), .tar.bz2 (bzip2), or .tar.xz (xz).
Tar archives are created and extracted with the tar utility, for example tar -cvf archive.tar dir to
Tarfile is the Python standard library module that provides read and write access to tar archives. It
Security and portability notes: extracting archives can pose risks if the archive contains files with absolute