Menu

#614 "Not implemented" when trying to rename files in a Windows 11 created zip

open
nobody
None
5
2025-01-23
2025-01-22
fireattack
No

When open the archive (attached) that is created by the built-in "Compressed to.." context menu feature in Windows 11, 7-zip said "not implemented" and failed to update the filename.

1 Attachments

Discussion

  • Igor Pavlov

    Igor Pavlov - 2025-01-22

    that file uses descriptor in file headers.

    7z l bug.zip -slt
    ----------
    Path = New Text Document.txt
    Folder = -
    Size = 0
    Packed Size = 2
    Modified = 2025-01-22 11:56:33
    Created =
    Accessed =
    Attributes =  -rw-rw-rw-
    Encrypted = -
    Comment =
    CRC = 00000000
    Method = Deflate
    Characteristics = ux UT:M:1 : Descriptor
    Host OS = Unix
    Version = 20
    Volume Index = 0
    Offset = 0
    

    7-Zip doesn't implement renaming for such files, because descriptor is complicated about additional optional headers after the end of data. We don't know what size of these additional optional headers, and we don't want to corrupt the archive during renaming.

    Please create another zip archive with non-empty file (non-zero size). And try to rename that file.
    What exact version of Windows 11 do you use?
    Does it always create zip file with Host OS = Unix and Descriptor in Characteristics?

     
  • fireattack

    fireattack - 2025-01-23

    Even non-empty file would cause the same issue:

    >7z l nonempty.zip -slt
    
    7-Zip 24.09 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-11-29
    
    Scanning the drive for archives:
    1 file, 200 bytes (1 KiB)
    
    Listing archive: nonempty.zip
    
    --
    Path = nonempty.zip
    Type = zip
    Physical Size = 200
    
    ----------
    Path = nonempty.txt
    Folder = -
    Size = 4
    Packed Size = 6
    Modified = 2025-01-23 09:32:31
    Created =
    Accessed =
    Attributes =  -rw-rw-rw-
    Encrypted = -
    Comment =
    CRC = 9BE3E0A3
    Method = Deflate
    Characteristics = ux UT:M:1 : Descriptor
    Host OS = Unix
    Version = 20
    Volume Index = 0
    Offset = 0
    

    And yes, it looks like it always has "Host OS = Unix and Descriptor in Characteristics".

    I use: Windows 11 Version 24H2 (OS Build 26100.2894)

     
  • Igor Pavlov

    Igor Pavlov - 2025-01-23

    Windows 10 has context menu option
    Send to / Compressed (zipped) folder
    And that command creates usual zip with Host OS: FAT items.

    Is there Send to / Compressed (zipped) folder option in Windows 11?

     
  • fireattack

    fireattack - 2025-01-23

    Just tried that -- yes it also produces the problematic files just as "compress to". Win10's is fine as you noted.

    >7z l nonempty_send_to_win10.zip -slt
    
    7-Zip 24.09 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-11-29
    
    Scanning the drive for archives:
    1 file, 126 bytes (1 KiB)
    
    Listing archive: nonempty_send_to_win10.zip
    
    --
    Path = nonempty_send_to_win10.zip
    Type = zip
    Physical Size = 126
    
    ----------
    Path = nonempty.txt
    Folder = -
    Size = 4
    Packed Size = 4
    Modified = 2025-01-23 15:39:56
    Created =
    Accessed =
    Attributes = A
    Encrypted = -
    Comment =
    CRC = 9BE3E0A3
    Method = Store
    Characteristics =
    Host OS = FAT
    Version = 20
    Volume Index = 0
    Offset = 0
    
    
    >7z l nonempty_send_to_win11.zip -slt
    
    7-Zip 24.09 (x64) : Copyright (c) 1999-2024 Igor Pavlov : 2024-11-29
    
    Scanning the drive for archives:
    1 file, 200 bytes (1 KiB)
    
    Listing archive: nonempty_send_to_win11.zip
    
    --
    Path = nonempty_send_to_win11.zip
    Type = zip
    Physical Size = 200
    
    ----------
    Path = nonempty.txt
    Folder = -
    Size = 4
    Packed Size = 6
    Modified = 2025-01-23 15:39:54
    Created =
    Accessed =
    Attributes =  -rw-rw-rw-
    Encrypted = -
    Comment =
    CRC = 9BE3E0A3
    Method = Deflate
    Characteristics = ux UT:M:1 : Descriptor
    Host OS = Unix
    Version = 20
    Volume Index = 0
    Offset = 0
    
     
  • Igor Pavlov

    Igor Pavlov - 2025-01-23

    Probably Windows 11 now use libarchive code.

    libarchive archive writes Unix type:

        archive_le16enc(zip->file_header + 4, 3 * 256 + version_needed);
    

    3 - is unix type.

    and libarchive probably always write descriptor, because they don't want to move back in written output stream to set crc field in header:

            /* We may know the size, but never the CRC. */
            zip->entry_flags |= ZIP_ENTRY_FLAG_LENGTH_AT_END;
    

    Does anybody know when Windows had switched to libarchive for zip archive creation feature?

     

    Last edit: Igor Pavlov 2025-01-23
    • Sam Tansy

      Sam Tansy - 2025-01-23

      Does anybody know when Windows had switched to libarchive for zip archive creation feature?

      Search does.

      Since May 2023:

      We have added native support for additional archive formats, including tar, 7-zip, rar, gz and many others using the libarchive open-source project.

       
    • Sam Tansy

      Sam Tansy - 2025-01-23

      and libarchive probably always write descriptor

      You can ask them on their gh.

      libarchive archive writes Unix type:

      Shouldn't Windows write FAT instead of UNIX?! *nix permissions in Windows are screwed, literally - very often all files have executable permission and stuff like that, posing potential problems, or at least annoyance to *nix users of there archives.
      Windows in not Unix and should not impostor it.

       
  • Igor Pavlov

    Igor Pavlov - 2025-01-23

    Now I suppose it's possible to implement renaming feature for such zip files with descriptor.
    So I'll look that feature for implementing in future.

     
    • Sam Tansy

      Sam Tansy - 2025-01-23

      Is that accordant with zip specification?

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.