Repository navigation
Closed
Copy link
Labels
Milestone
Description
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:
runtime/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipVersion.cs
Lines 21 to 22 in e1d4048
| /// 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
dotnet-policy-service commentedon Feb 23, 2026
Tagging subscribers to this area: @karelz, @dotnet/area-system-io-compression
See info in area-owners.md if you want to be subscribed.
MihuBot commentedon Feb 23, 2026
I'm a bot. Here is a possible related and/or duplicate issue (I may be wrong):
ZipFile.ExtractToDirectorycauses faulty permissions with pinned files #94465MihaZupan commentedon Jun 30, 2026
Having "Version" in the name feels out of place, what is it trying to communicate? Or could it be just dropped?
alinpahontu2912 commentedon Jun 30, 2026
It's called version made by in the specs, so I left the name as is.
GrabYourPitchforks commentedon Jun 30, 2026
@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. :)
bartonjs commentedon Jun 30, 2026
Video
Add public Property for VersionMadeBy flag in zipfiles (#130109)
Add public Property for VersionMadeBy flag in zipfiles (#130109)