Changeset 6642


Ignore:
Timestamp:
Mar 27, 2009, 2:33:55 PM (15 years ago)
Author:
rwilson
Message:

Minor(ish) changes to untar tool.

Location:
misc/tools/tar_file
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • misc/tools/tar_file/README

    r6632 r6642  
    22zipped files from a file or directory.
    33
    4 Use it so:  tar_file.py <fileordir>
     4Use it so:
     5    tar_file.py <tarfilename> [<fileordir>, ...]
     6The created file is <tarfilename>.
    57
    6 The tarred file created will be <fileordir>.tgz.
     8Also here is the corresponding program to untar files:
     9    untar_file.py <tarfilename>
  • misc/tools/tar_file/untar_file.py

    r6640 r6642  
    1313# print usage info. and exit
    1414def usage():
    15     print 'usage: %s <tarfile>' % Prog_Name
    16     print 'where <tarfile> is the path to the file to untar.'
     15    print 'usage: %s <tarfile> [<output_directory>]' % Prog_Name
     16    print 'where <tarfile>          is the path to the file to untar,'
     17    print '  and <output_directory> is the directory to write the results into.'
    1718    sys.exit(10)
    1819
     
    2223
    2324# check args
    24 if len(sys.argv) != 2:
     25if len(sys.argv) != 2 and len(sys.argv) != 3:
    2526    usage()
    2627
    2728# create the tarred/compressed file
    28 untar_file(sys.argv[1])
     29if len(sys.argv) == 2:
     30    untar_file(sys.argv[1])
     31else:
     32    untar_file(sys.argv[1], sys.argv[2])
Note: See TracChangeset for help on using the changeset viewer.