ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

JAR and IFS directories

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • JAR and IFS directories

    So I got lost trying to figure this out. I need to zip the contents of a directory but nothing I have tried has worked. I would prefer to be able to do wildcards like *2015* and such but to make it simpler I simply moved the objects I need to compress. I know I can list file after file and even add to an archive but when directories have tens of thousands of files it is a bit more difficult.

    So why cannot get a jar cfM myjarfile /dir/*.txt or such to work?

  • #2
    well I found a solution jar -cfM myzip.zip -C /mydirectory/ .

    Comment


    • #3
      Because the wildcards are not resolved by Java/Jar, they are resolved by the shell. The shell finds all files that match the wildcard, and inserts them into the command string, and then runs the command. If there are tends of thousands, it is building a very long command string with tens of thousands of parameters -- and the system may not support that many parameters.

      The way you're doing it is better.

      Comment

      Working...
      X