Menu

How to extract windows ZIP file in Linux

Help
Tomas
2016-03-31
2016-03-31
  • Tomas

    Tomas - 2016-03-31

    Hi,
    I have ZIP file from Windows with some path inside, but when I try to unzip it with 7z in linux by this command:
    7z x zip_file.zip
    It doesn't create directory as it is in ZIP file, but in ZIP there are directories like:
    folder\name_of_file.txt
    But I'm on linux, so no path with "\".
    Why 7z can't convert folder\bubu.txt to folder/bubu.txt ??
    Thank you for reply.
    T.

     
  • Igor Pavlov

    Igor Pavlov - 2016-03-31

    call

    7z l zip_file.zip -slt > list.txt
    

    Do you use p7zip?
    If so, probably you must write to p7zip forum.
    What program was used to create that zip file?
    Note also that '\' character is allowed in filename in linux.

     
    • Tomas

      Tomas - 2016-03-31

      No just 7z.
      Here is the list.txt.
      It's little bit big :)
      Edit: I forgot, it's made by JAVA tool by some our company application.

       

      Last edit: Tomas 2016-03-31
  • Igor Pavlov

    Igor Pavlov - 2016-03-31

    It's p7zip.

    from zip specification:

    All slashes
           MUST be forward slashes '/' as opposed to
           backwards slashes '\' for compatibility with Amiga
           and UNIX file systems etc.
    

    So your "JAVA tool" probably produces "wrong" zip archives.
    You can notify developers of that "JAVA tool" about that problem. Maybe they can fix it.

    Note also about files properies:
    Host OS = FAT
    so p7zip can convert wrong back slashes to correct forward slashes, if it's 'FAT' Host OS. But probably it's not implemented still in p7zip / 7-zip. Maybe I should implement it in original 7-zip, but there is no problem in Windows version.

     
  • Tomas

    Tomas - 2016-03-31

    Oh you're rightit's p7zip name, sorry that I didn't see it on the 2nd row :-(

    Well, that JAVA tool is some external java class, like "java.util.zip" or so.

    Well now I don't know how to handle that weird umlaut names of names in that ZIP file :-/
    Unzip brokes characters, atool too. 7z (or p7zip) did it correctly, but without directories.
    But it's not your problem, because it's different program.
    Ok then. Thank you for you answer.

     

Log in to post a comment.