• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • IBM i and Zip Files

    January 11, 2012 Ted Holt

    You may have heard of the new zip file APIs–QZipZip and QZipUnzip–that IBM added to IBM i 7.1. I am looking forward to using them. But if your shop is like mine, that is, you’re not running 7.1, there’s another way to work with zip files, and it does a good job.

    The other way is the Java Archive utility, or jar. It’s an easy command to use, and it runs under Qshell. Here’s how it works.

    The jar command has several parameters. First is a case-sensitive list of options. You will always need a lowercase “f” option.

    Second is the name of the jar or zip file. Whether you need additional parameters or not depends on the list of options.

    I think the best way to show you how to use jar is to provide some examples. First, here’s how to create a zip file called “files.zip” to contain files “file01.txt” and “file02.txt”.

    jar cfM files.zip file01.txt file02.txt
    

    Option “c” means that the archive file is being created. Option “f” means that the second parameter contains the archive filename. Option “M” tells jar not to create a manifest file. Notice that “M” is uppercase. You don’t have to know what a manifest file is.

    The files to be zipped are named in the third and following parameters. These file names may include wildcards.

    Now view the contents of the archive.

    jar tf files.zip
    

    Option “t” means to view the list of files in the archive.

    Extract the files from (unzip) the archive.

    jar xf files.zip
    

    Option “x” stands for “extract”.

    Add another file, “file03.txt”, to the archive.

    jar ufM files.zip file03.txt
    

    Option “u” means to update the archive. Notice option “M” again.

    I assume you’ll be exchanging archive files with PCs. If so, be aware that you need to create IFS files with a code page that other systems can use, such as 819 (one of the ASCII code pages).

    For more information about the new zip APIs, visit IBM’s announcement letter. To learn more about jar, visit the Java Archive Tool page.



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Raz-Lee Security

    Protect Your IBM i and/or AIX Servers with a Free Virus Scan

    Cyber threats are a reality for every platform, including IBM i and AIX servers. No system is immune, and the best defense is prompt detection and removal of viruses to prevent costly damage. Regulatory standards across industries mandate antivirus protection – ensure your systems are compliant and secure.

    Get My Free Virus Scan

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Databorough:  Get ready for modernization or upgrades with X-Analysis 9.5
    Guild Companies:  The All-Everything Operating System, by Brian Kelly, Price $35
    CCSS:  Achieving Lights Out Automation in an IBM i environment. Get the Best Practice guide

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    IBM Updates Software Inventory and Usage Tool Control Your Code, Control Your Costs And Destiny

    Leave a Reply Cancel reply

Volume 12, Number 1 -- January 11, 2012
THIS ISSUE SPONSORED BY:

WorksRight Software
ProData Computer Services
Twin Data Corporation

Table of Contents

  • New in DB2 for i 7.1: Use Global Variables to Track Environment Settings
  • IBM i and Zip Files
  • Admin Alert: Is It a Performance Issue or a Throughput Issue?

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • POWERUp 2025 –Your Source For IBM i 7.6 Information
  • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set
  • As I See It: At Any Cost
  • IBM i PTF Guide, Volume 27, Number 19
  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle