Last change
on this file since 8813 was
8427,
checked in by davies, 12 years ago
|
Adding the trapezoidal channel validation test, and editing the ANUGA manual
|
File size:
752 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | '''A program to create tar files from a file or directory.''' |
---|
4 | |
---|
5 | import sys |
---|
6 | import os |
---|
7 | from anuga.utilities.system_tools import tar_file |
---|
8 | |
---|
9 | # assumed program name - refreshed from command line args |
---|
10 | Prog_Name = 'tar_file.py' |
---|
11 | |
---|
12 | # print usage info. and exit |
---|
13 | def usage(): |
---|
14 | print 'usage: %s <tarfile> <file1> [<file2>, ...]' % Prog_Name |
---|
15 | print 'where <tarfile> is the path to the tar file to create,' |
---|
16 | print ' <file?> is the path to a file or directory to include.' |
---|
17 | sys.exit(10) |
---|
18 | |
---|
19 | # get program name |
---|
20 | # does this work on Windows? |
---|
21 | Prog_Name = os.path.basename(sys.argv[0]) |
---|
22 | |
---|
23 | # check args |
---|
24 | if len(sys.argv) < 2: |
---|
25 | usage() |
---|
26 | |
---|
27 | # create the tarred/compressed file |
---|
28 | tar_file(sys.argv[2:], sys.argv[1]) |
---|
Note: See
TracBrowser
for help on using the repository browser.