Zip and Unzip files on the iSeries

Zip files also known as archive file are very easy to create using the QSHELL jar command.

Syntax for the Command

jar {ctxu}[vfm0Mi] [jar-file] [manifest-file] [-C dir] files ...
Options:                                                                    
    -c  create new archive                                                  
    -t  list table of contents for archive                                  
    -x  extract named (or all) files from archive                           
    -u  update existing archive                                             
    -v  generate verbose output on standard output                          
 -f  specify archive file name                                           
    -m  include manifest information from specified manifest file           
    -0  store only; use no ZIP compression                                  
    -M  do not create a manifest file for the entries                       
    -i  generate index information for the specified jar files              
    -C  change to the specified directory and include the following file
Tip: If any file is a directory then it is processed recursively. The manifest file name and the archive file name needs to be specified in the same order the 'm' and 'f' flags are specified.

Example to archive/zip one or more files

jar cvf myArchive.zip file1.txt file2.txt file3.xls file4.doc                                

Example to extract/unzip one or more files

jar xvf myArchive.zip     

No comments :

Post a Comment