Search code examples
unixzip

"zip name not matched" for some files in the folder structure


I have the complicated folder structure and file names -- result of numerical experiments. I want to zip them to a single file omitting the folder structure. For some inexplicable reason it works for one file and does not work for another. Both files are very similarly named and both files exist:

<> ll ./jobs/3/4/5/7/ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=2_recorded
... users 79130866 Jul 11 00:05 ./jobs/3/4/5/7/ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=2_recorded

<> zip -j test ./jobs/3/4/5/7/ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=2_recorded
  adding: ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=2_recorded (deflated 68%)


<> ll ./jobs/3/4/5/6/ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=0_recorded
... users 78912343 Jul 11 00:05 ./jobs/3/4/5/6/ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=0_recorded

<> zip -j test ./jobs/3/4/5/6/ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=0_recorded
    zip warning: name not matched: ./jobs/3/4/5/6/ions_Phosphorus_e=10_d=1e+13_so=0_rot=0_tlt=0_recorded

zip error: Nothing to do! (test.zip)

Any thoughts, please?

UPD. Thanks to the @Seshagiri Sriram I found that I was using to old version of '''zip''' -- with the newer version this problem does not appear.


Solution

  • My 2 cents. Instead of zip -j, a plain zip would add with directory structure and allow for 2nd file to be added, not updated (this is not germane to the issue and my apologies beforehand). I noted that the file name contains an equal sign(=) . I am not sure of the internals, but the following worked:

    zip test ./jobs/3/4/5/6/ion*recorded
    zip test ./jobs/3/4/5/7/ion*recorded 
    

    EDIT: Screen shot of output EDIT: Zip version