source: misc/tools/tar_file/untar_file.py @ 6640

Last change on this file since 6640 was 6640, checked in by rwilson, 15 years ago

Added untar_file.py program.

File size: 643 bytes
Line 
1#!/usr/bin/env python
2
3'''A program to create tar files from a file or directory.'''
4
5import sys
6import os
7from anuga.utilities.system_tools import untar_file
8
9
10# assumed program name - refreshed from command line args
11Prog_Name = 'untar_file.py'
12
13# print usage info. and exit
14def usage():
15    print 'usage: %s <tarfile>' % Prog_Name
16    print 'where <tarfile> is the path to the file to untar.'
17    sys.exit(10)
18
19# get program name
20# does this work on  Windows?
21Prog_Name = os.path.basename(sys.argv[0])
22
23# check args
24if len(sys.argv) != 2:
25    usage()
26
27# create the tarred/compressed file
28untar_file(sys.argv[1])
Note: See TracBrowser for help on using the repository browser.