- Timestamp:
- Mar 27, 2009, 2:33:55 PM (16 years ago)
- Location:
- misc/tools/tar_file
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
misc/tools/tar_file/README
r6632 r6642 2 2 zipped files from a file or directory. 3 3 4 Use it so: tar_file.py <fileordir> 4 Use it so: 5 tar_file.py <tarfilename> [<fileordir>, ...] 6 The created file is <tarfilename>. 5 7 6 The tarred file created will be <fileordir>.tgz. 8 Also here is the corresponding program to untar files: 9 untar_file.py <tarfilename> -
misc/tools/tar_file/untar_file.py
r6640 r6642 13 13 # print usage info. and exit 14 14 def 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.' 17 18 sys.exit(10) 18 19 … … 22 23 23 24 # check args 24 if len(sys.argv) != 2 :25 if len(sys.argv) != 2 and len(sys.argv) != 3: 25 26 usage() 26 27 27 28 # create the tarred/compressed file 28 untar_file(sys.argv[1]) 29 if len(sys.argv) == 2: 30 untar_file(sys.argv[1]) 31 else: 32 untar_file(sys.argv[1], sys.argv[2])
Note: See TracChangeset
for help on using the changeset viewer.