Skip to content

[API Proposal]: Make ZipArchiveEntry ZipVersionMadeByPlatform byte public #124755

Description

@alinpahontu2912

Background and motivation

  • Internally, _versionMadeBy is already in use, but as an internal field.
  • Currently, it is only used when parsing the name of an entry, not when extracting it. When unzipping entries created on Linux on Windows and vice-versa, file permissions can be wrongly assesed. Making it public would make it easier to check and verify permissios. ( This field and the extractionmethod live in different assemblies, hence the need to make it a public property ).
  • No breaking changes, since property is read-only.

API Proposal

Expose the enum ZipVersionMadeByPlatform, containing reference values for the system an entry was created on.

namespace System.IO.Compression
{
-    internal enum ZipVersionMadeByPlatform : byte
+    public enum ZipVersionMadeByPlatform
     {
         Windows = 0,
+        Amiga = 1,
+        OpenVms = 2,
         Unix = 3,
+        VmCms = 4,
+        AtariSt = 5,
+        Os2Hpfs = 6,
+        Macintosh = 7,
+        ZSystem = 8,
+        CpM = 9,
+        WindowsNtfs = 10, // never seen in practice, check note below
+        Mvs = 11,
+        Vse = 12,
+        AcornRisc = 13,
+        VFat = 14,
+        AlternateMvs = 15,
+        BeOs = 16,
+        Tandem = 17,
+        Os400 = 18,
+        OsXDarwin = 19
     }
}

Values higher or equal than 20 are unused.
Convention is Windows will always be 0. See comment here:

/// The value of 0 more specifically corresponds to the FAT file system while NTFS is assigned a higher value. However
/// for historical and compatibility reasons, Windows is always assigned a 0 value regardless of file system.

namespace System.IO.Compression
{
    public class ZipArchiveEntry
    {
+        public ZipVersionMadeByPlatform VersionMadeByPlatform { get; }
    }
}

API Usage

using var archive = ZipFile.OpenRead("archive.zip");
foreach (var entry in archive.Entries)
{
    Console.WriteLine($"{entry.FullName} Pltform Bit: {entry.VersionMadeByPlatform}");
}

Alternative Designs

No response

Risks

No response

Activity

  1. added
    api-suggestion
    on Feb 23, 2026
  2. added
    untriaged
    on Feb 23, 2026
  3. dotnet-policy-service commented on Feb 23, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
    See info in area-owners.md if you want to be subscribed.

  4. MihuBot commented on Feb 23, 2026

    @MihuBot

    I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):

  5. removed
    untriaged
    on Feb 26, 2026
  6. added this to the 11.0.0 milestone on Feb 26, 2026
  7. added theissue type on Jun 9, 2026
  8. added
    api-ready-for-review
    and removed
    api-suggestion
    on Jun 22, 2026
  9. MihaZupan commented on Jun 30, 2026

    @MihaZupan
    Member

    Having "Version" in the name feels out of place, what is it trying to communicate? Or could it be just dropped?

  10. alinpahontu2912 commented on Jun 30, 2026

    @alinpahontu2912
    MemberAuthor

    It's called version made by in the specs, so I left the name as is.

  11. GrabYourPitchforks commented on Jun 30, 2026

    @GrabYourPitchforks
    Member

    @alinpahontu2912 Just as a followup reminder, can you drop a quick note in the comments here regarding why we don't need a setter? (That is, given that we publish a netstandard library and don't necessarily know what platform the runtime targets, why is it ok that we're hardcoded to Windows or Unix in the setters?)

    Edit: No longer relevant now that there's no enum. :)

  12. bartonjs commented on Jun 30, 2026

    @bartonjs
    Member

    Video

    • Rather than expose the enum (and need to name all the things), let's just expose the ushort as the spec calls it:
    namespace System.IO.Compression
    {
       public partial class ZipArchiveEntry
       {
            public ushort VersionMadeBy { get; }
       }
    }
  13. added
    api-approved
    and removed
    api-ready-for-review
    on Jun 30, 2026
  14. added a commit that references this issue on Jul 7, 2026
    f7ac8dc
  15. added a commit that references this issue on Jul 15, 2026
    b09ef7e
  16. locked and limited conversation to collaborators on Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api-approvedarea-System.IO.Compression

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions