Giter Club home page Giter Club logo

tar.py's Introduction

tar.py

Utility for creating Linux tar.gz archives with proper file permissions (executable bit set) on Windows

Usage: tar.py [out] [file1] [file2] ... [fileN]
Do not add extension to out file
Add +x at the end of a file to set executable bit
Directories are added recursively, files already added are skipped
Options:
  -autoexec    Detect and set executable file permissions automatically

Examples

Compress a directory test to thing.tar.gz

python tar.py thing test

Compress a directory myapp with various executables to myapp100.tar.gz

python tar.py -autoexec myapp100 myapp

Compress a readme.txt and executable run.sh file to stuff.tar.gz

python tar.py stuff readme.txt run.sh+x

Compress a directory payload with executable run.sh file to blah.tar.gz

python tar.py blah payload/run.sh+x payload

Note that run.sh+x must come before the directory so that it is skipped when encountered

tar.py's People

Contributors

enichan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tar.py's Issues

Script doesn't work as expected with different directories

If you run the script from a location not the same as the input and output, the archive created has the name of all directories in the path.

Example
Create a folder called SCRIPTS and place it on the Desktop with the tar.py script inside.
Open Command Prompt and type:

c:\users\bob\desktop\SCRIPTS\tar.py -autoexec c:\users\bob\desktop\thing c:\users\bob\desktop\test

This works, however, the name of each directory is added to the archive as you can see in the screenshot. The final directory specified (IE test) should be the 1st.
output

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.