From 50f0f3a9a90226d7f250ea2976899a7ba4135930 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Jun 2025 02:41:08 +0000 Subject: [PATCH 1/4] Initial plan for issue From ab7dcfd44cd0199f9b426d93f69db0d592594e3e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 6 Jun 2025 02:49:02 +0000 Subject: [PATCH 2/4] Add breaking change documentation for GnuTarEntry and PaxTarEntry atime/ctime behavior Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/core/compatibility/10.0.md | 1 + .../10.0/tar-atime-ctime-default.md | 51 +++++++++++++++++++ docs/core/compatibility/toc.yml | 2 + 3 files changed, 54 insertions(+) create mode 100644 docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index 2585f8ebd1f6a..8f91f5800117b 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -30,6 +30,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | [C# 14 overload resolution with span parameters](core-libraries/10.0/csharp-overload-resolution.md) | Behavioral change | Preview 1 | | [Consistent shift behavior in generic math](core-libraries/10.0/generic-math.md) | Behavioral change | Preview 1 | | [Default trace context propagator updated to W3C standard](core-libraries/10.0/default-trace-context-propagator.md) | Behavioral change | Preview 4 | +| [GnuTarEntry and PaxTarEntry no longer includes atime and ctime by default](core-libraries/10.0/tar-atime-ctime-default.md) | Behavioral change | Preview 5 | | [LDAP DirectoryControl parsing is now more stringent](core-libraries/10.0/ldap-directorycontrol-parsing.md) | Behavioral change | Preview 1 | | [MacCatalyst version normalization](core-libraries/10.0/maccatalyst-version-normalization.md) | Behavioral change | Preview 1 | | [System.Linq.AsyncEnumerable included in core libraries](core-libraries/10.0/asyncenumerable.md) | Source incompatible | Preview 1 | diff --git a/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md b/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md new file mode 100644 index 0000000000000..3a35c2599f3ef --- /dev/null +++ b/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md @@ -0,0 +1,51 @@ +--- +title: "Breaking change: GnuTarEntry and PaxTarEntry no longer includes atime and ctime by default" +description: "Learn about the breaking change in .NET 10 where GnuTarEntry and PaxTarEntry no longer automatically set access time and change time fields." +ms.date: 01/30/2025 +ai-usage: ai-assisted +ms.custom: https://github.com/dotnet/docs/issues/46465 +--- +# GnuTarEntry and PaxTarEntry no longer includes atime and ctime by default + +Starting in .NET 10, and no longer automatically set access time (`atime`) and change time (`ctime`) fields when creating new entries. These fields are problematic in tar entries because not all tar readers support them. + +## Version introduced + +.NET 10 Preview 5 + +## Previous behavior + +Previously, `GnuTarEntry` and `PaxTarEntry` always added `atime` and `ctime` values when creating new entries. + +## New behavior + +Starting in .NET 10, `GnuTarEntry` and `PaxTarEntry` only set `atime` and `ctime` if: + +- The entry was read from a tar archive that already contained these fields +- The user explicitly sets them using the appropriate properties + +The behavior of remains unchanged. It's initialized to for tar entries created with a constructor, and uses the file modification time for entries created from files. + +## Type of breaking change + +This is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +Better compatibility with other tar readers and improved round-tripping of tar files without modification. The `atime` and `ctime` fields create tar files that aren't readable by many tar clients. + +## Recommended action + +No action required for most users. If you require these fields to be set, you can do so directly: + +- For `GnuTarEntry`: Use and properties +- For `PaxTarEntry`: Use the constructor that accepts extended attributes: + +However, be aware that setting these fields creates a tar file that might not be readable by many tar clients. + +## Affected APIs + +- +- +- +- diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 4839bacb0f436..4c7cb8201e584 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -24,6 +24,8 @@ items: href: core-libraries/10.0/generic-math.md - name: Default trace context propagator updated to W3C Standard href: core-libraries/10.0/default-trace-context-propagator.md + - name: GnuTarEntry and PaxTarEntry no longer includes atime and ctime by default + href: core-libraries/10.0/tar-atime-ctime-default.md - name: LDAP DirectoryControl parsing is now more stringent href: core-libraries/10.0/ldap-directorycontrol-parsing.md - name: MacCatalyst version normalization From c0e7709acf1e6b25d6a738761345af0d2ae49c0b Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 5 Jun 2025 20:02:49 -0700 Subject: [PATCH 3/4] human edits --- .../10.0/tar-atime-ctime-default.md | 28 +++++++++++-------- docs/core/compatibility/toc.yml | 18 ++++++------ 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md b/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md index 3a35c2599f3ef..a8c0fb9a9b820 100644 --- a/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md +++ b/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md @@ -1,13 +1,17 @@ --- -title: "Breaking change: GnuTarEntry and PaxTarEntry no longer includes atime and ctime by default" +title: "Breaking change: GnuTarEntry and PaxTarEntry exclude atime and ctime by default" description: "Learn about the breaking change in .NET 10 where GnuTarEntry and PaxTarEntry no longer automatically set access time and change time fields." -ms.date: 01/30/2025 +ms.date: 06/05/2025 ai-usage: ai-assisted ms.custom: https://github.com/dotnet/docs/issues/46465 --- -# GnuTarEntry and PaxTarEntry no longer includes atime and ctime by default +# GnuTarEntry and PaxTarEntry exclude atime and ctime by default -Starting in .NET 10, and no longer automatically set access time (`atime`) and change time (`ctime`) fields when creating new entries. These fields are problematic in tar entries because not all tar readers support them. +Starting in .NET 10, and no longer automatically set access time (`atime`) and change time (`ctime`) fields when creating new entries. These fields are problematic in tar entries because not all tar readers support them. The fields will still be preserved when reading, and you set them directly. But they won't be set on existing entries that didn't have them to start, or when converting from other entry types. + +The behavior of is unchanged. It's initialized to for tar entries created with a constructor, and uses the file modification time for entries created from files. + +Other minor fixes have been made to to prioritize round-tripping of `TarEntry` entries from read to write without change. ## Version introduced @@ -21,8 +25,8 @@ Previously, `GnuTarEntry` and `PaxTarEntry` always added `atime` and `ctime` val Starting in .NET 10, `GnuTarEntry` and `PaxTarEntry` only set `atime` and `ctime` if: -- The entry was read from a tar archive that already contained these fields -- The user explicitly sets them using the appropriate properties +- The entry is read from a tar archive that already contains these fields. +- The user explicitly set them using the appropriate properties. The behavior of remains unchanged. It's initialized to for tar entries created with a constructor, and uses the file modification time for entries created from files. @@ -32,16 +36,18 @@ This is a [behavioral change](../../categories.md#behavioral-change). ## Reason for change -Better compatibility with other tar readers and improved round-tripping of tar files without modification. The `atime` and `ctime` fields create tar files that aren't readable by many tar clients. +This change was made for better compatibility with other tar readers and to improve round-tripping of tar files without modification. ## Recommended action -No action required for most users. If you require these fields to be set, you can do so directly: +No action required for most users—most archives have no use for these timestamps. + +If you require these fields to be set, you can use the following APIs: -- For `GnuTarEntry`: Use and properties -- For `PaxTarEntry`: Use the constructor that accepts extended attributes: +- For `GnuTarEntry`: Use the and properties. +- For `PaxTarEntry`: Use the constructor that accepts extended attributes: . -However, be aware that setting these fields creates a tar file that might not be readable by many tar clients. +However, be aware that setting these fields creates a tar file that isn't readable by many tar clients. ## Affected APIs diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 4c7cb8201e584..057e57d3a60d9 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -24,14 +24,14 @@ items: href: core-libraries/10.0/generic-math.md - name: Default trace context propagator updated to W3C Standard href: core-libraries/10.0/default-trace-context-propagator.md - - name: GnuTarEntry and PaxTarEntry no longer includes atime and ctime by default + - name: GnuTarEntry and PaxTarEntry exclude atime and ctime by default href: core-libraries/10.0/tar-atime-ctime-default.md - name: LDAP DirectoryControl parsing is now more stringent href: core-libraries/10.0/ldap-directorycontrol-parsing.md - name: MacCatalyst version normalization href: core-libraries/10.0/maccatalyst-version-normalization.md - name: System.Linq.AsyncEnumerable included in core libraries - href: core-libraries/10.0/asyncenumerable.md + href: core-libraries/10.0/asyncenumerable.md - name: Cryptography items: - name: X500DistinguishedName validation is stricter @@ -87,7 +87,7 @@ items: - name: WPF items: - name: Incorrect usage of DynamicResource causes application crash - href: wpf/10.0/dynamicresource-crash.md + href: wpf/10.0/dynamicresource-crash.md - name: .NET 9 items: - name: Overview @@ -117,7 +117,7 @@ items: - name: Altered UnsafeAccessor support for non-open generics href: core-libraries/9.0/unsafeaccessor-generics.md - name: Ambiguous overload resolution affecting StringValues implicit operators - href: core-libraries/9.0/ambiguous-overload.md + href: core-libraries/9.0/ambiguous-overload.md - name: API obsoletions with custom diagnostic IDs href: core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md - name: BigInteger maximum length @@ -221,7 +221,7 @@ items: - name: Nullable JsonDocument properties deserialize to JsonValueKind.Null href: serialization/9.0/jsondocument-props.md - name: System.Text.Json metadata reader now unescapes metadata property names - href: serialization/9.0/json-metadata-reader.md + href: serialization/9.0/json-metadata-reader.md - name: Windows Forms items: - name: BindingSource.SortDescriptions doesn't return null @@ -1410,6 +1410,8 @@ items: href: core-libraries/10.0/generic-math.md - name: Default trace context propagator updated to W3C Standard href: core-libraries/10.0/default-trace-context-propagator.md + - name: GnuTarEntry and PaxTarEntry exclude atime and ctime by default + href: core-libraries/10.0/tar-atime-ctime-default.md - name: LDAP DirectoryControl parsing is now more stringent href: core-libraries/10.0/ldap-directorycontrol-parsing.md - name: MacCatalyst version normalization @@ -1423,7 +1425,7 @@ items: - name: Altered UnsafeAccessor support for non-open generics href: core-libraries/9.0/unsafeaccessor-generics.md - name: Ambiguous overload resolution affecting StringValues implicit operators - href: core-libraries/9.0/ambiguous-overload.md + href: core-libraries/9.0/ambiguous-overload.md - name: API obsoletions with custom diagnostic IDs href: core-libraries/9.0/obsolete-apis-with-custom-diagnostics.md - name: BigInteger maximum length @@ -2127,7 +2129,7 @@ items: - name: Nullable JsonDocument properties deserialize to JsonValueKind.Null href: serialization/9.0/jsondocument-props.md - name: System.Text.Json metadata reader now unescapes metadata property names - href: serialization/9.0/json-metadata-reader.md + href: serialization/9.0/json-metadata-reader.md - name: .NET 8 items: - name: BinaryFormatter disabled for most projects @@ -2307,7 +2309,7 @@ items: - name: .NET 10 items: - name: Incorrect usage of DynamicResource causes application crash - href: wpf/10.0/dynamicresource-crash.md + href: wpf/10.0/dynamicresource-crash.md - name: .NET 9 items: - name: "'GetXmlNamespaceMaps' type change" From 7d8d1ce991620c6b1f1bd6189ffb3f9351bd5be0 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Thu, 5 Jun 2025 20:08:40 -0700 Subject: [PATCH 4/4] ctor --- .../core-libraries/10.0/tar-atime-ctime-default.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md b/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md index a8c0fb9a9b820..49a023cfa3d9a 100644 --- a/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md +++ b/docs/core/compatibility/core-libraries/10.0/tar-atime-ctime-default.md @@ -45,7 +45,7 @@ No action required for most users—most archives have no use for these time If you require these fields to be set, you can use the following APIs: - For `GnuTarEntry`: Use the and properties. -- For `PaxTarEntry`: Use the constructor that accepts extended attributes: . +- For `PaxTarEntry`: Use the constructor that accepts extended attributes: . However, be aware that setting these fields creates a tar file that isn't readable by many tar clients.