Python Forum
a command to write i just thought of
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a command to write i just thought of
#1
i just needed such a command so i thought of writing it. it would be intended to compress a file and also report the compression ratio (input size / output size). my first thought is for it to take the compression command as arguments. but that is not going to be as easy to use as is defaulting to the user's preferred compression and being given file names as arguments or in stdin. for each file it compresses, output one line to stderr with the input size and output size and the ration, each formatted to be the same width in each line. the name of the file would be the last thing on each line since it varies in width.

other features:

if no arguments or for an argument of "-" compress stdin to stdout.
run as many compression processes concurrently as number of total cores. support a "-m" option to force a number of cores or "-s" to use just one core.
support "-0" option (decimal digit) to be compression level passed to compression program.
support "-d" option to do decompress (or if command name has "de" or "un" in it).

what else should it include as a portable script?

should i write it? i could only do it for Linux.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  does anyon want to write an untabify command? Skaperen 10 3,700 Sep-09-2019, 06:05 AM
Last Post: Skaperen
  March Madness - Please give advice on my project thought PrasadPython 2 2,430 Mar-20-2019, 12:59 AM
Last Post: PrasadPython

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020