• 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
    FalconStor

    Protect It or Lose It and Pay Ransom for It

    FalconStor StorSafe VTL protects your IBM i data on-premise and brings the IBM PowerVS Cloud to you

    FalconStor powers secure and encrypted IBM i backups on-premise and now, working with IBM, powers migration to the IBM PowerVS cloud and on-going backup to IBM cloud object storage.

    Now you can use the IBM PowerVS Cloud as your secure offsite copy and take advantage of a hybrid cloud architecture or you can migrate workloads – test & development or even production apps – to the Power VS Cloud with secure cloud-native backup, powered by FalconStor and proven IBM partners.

    Learn How FalconStor Protects the IBM Cloud

    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

  • LANSA Developing Business Intelligence Tool
  • Blazing The Trail For VTL In The Cloud
  • Data De-Dupe Gives VTL Customers More Options
  • Four Hundred Monitor, March 29
  • The Big Spending On IT Security Is Only Going To Get Bigger
  • IBM Tweaks Some Power Systems Prices Down, Others Up
  • Disaster Recovery: From OS/400 V5R3 To IBM i 7.4 In 36 Hours
  • The Disconnect In Modernization Planning And Execution
  • Superior Support: One Of The Reasons You Pay The Power Systems Premium
  • IBM i PTF Guide, Volume 25, Number 13

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 © 2023 IT Jungle