Coder Social home page Coder Social logo

pytar's Introduction

pytar

Script to fix an interrupted/truncated tar file without a full extraction

Uses tarfile (python >= 2.7) to read a tarfile member by member (also gzipped but not bz2), and insert it into a new tarfile (maybe gzipped). When it fails to read a file or the file is shorter than declared in the tar file, it closes the output file and exits.

Question: what are the tarfile internals for seeking back and forth in a tar file, either gzipped or not? That would define the envelope of uses.

Usage: ./pytar.py [-v] [-h] .tar{.gz}? .tar{.gz}?

Could be loaded as a module. The entry point would be pytar.convert(srcname, sinkname, imode='', omode='')

where imode and omode can be 'gz', srcname is the full existing name and sinkname is the full name of the new tar file to be created (include 'gz' if it is to be gzipped). In that case, pytar.verbose is a global flag for stderr verbose output

pytar's People

Contributors

apeyser avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.