You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.Formats.Tar: default to no ctime/atime. (#115778)
* System.Formats.Tar: default to no ctime/atime.
atime and ctime are not well supported on non-PAX formats.
Even for PAX formats, tools do not include these timestamps by default because they are of limited use.
This makes .NET to also default to not include these timestamps.
* Add back attribute lists in the XML docs.
* Copy atime/ctime.
* Move atime/ctime copy back to GnuTarEntry ctor.
* Test conversion with atime/ctime set.
Copy file name to clipboardExpand all lines: src/libraries/System.Formats.Tar/src/System/Formats/Tar/PaxGlobalExtendedAttributesTarEntry.cs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ public PaxGlobalExtendedAttributesTarEntry(IEnumerable<KeyValuePair<string, stri
28
28
:base(TarEntryType.GlobalExtendedAttributes,nameof(PaxGlobalExtendedAttributesTarEntry),TarEntryFormat.Pax,isGea:true)// Name == name of type for lack of a better temporary name until the entry is written
/// <para>Use the <see cref="PaxTarEntry(TarEntryType, string, IEnumerable{KeyValuePair{string, string}})"/> constructor to include additional extended attributes when creating the entry.</para>
34
-
/// <para>The following entries are always found in the Extended Attributes dictionary of any PAX entry:</para>
35
-
/// <list type="bullet">
36
-
/// <item>Modification time, under the name <c>mtime</c>, as a <see cref="double"/> number.</item>
37
-
/// <item>Access time, under the name <c>atime</c>, as a <see cref="double"/> number.</item>
38
-
/// <item>Change time, under the name <c>ctime</c>, as a <see cref="double"/> number.</item>
39
-
/// <item>Path, under the name <c>path</c>, as a string.</item>
40
-
/// </list>
41
-
/// <para>The following entries are only found in the Extended Attributes dictionary of a PAX entry if certain conditions are met:</para>
42
-
/// <list type="bullet">
43
-
/// <item>Group name, under the name <c>gname</c>, as a string, if it is larger than 32 bytes.</item>
44
-
/// <item>User name, under the name <c>uname</c>, as a string, if it is larger than 32 bytes.</item>
45
-
/// <item>File length, under the name <c>size</c>, as an <see cref="int"/>, if the string representation of the number is larger than 12 bytes.</item>
46
-
/// </list>
33
+
/// <para>Use the <see cref="PaxTarEntry(TarEntryType, string, IEnumerable{KeyValuePair{string, string}})"/> constructor to include extended attributes when creating the entry.</para>
47
34
/// </remarks>
48
35
/// <exception cref="ArgumentNullException"><paramref name="entryName"/> is <see langword="null"/>.</exception>
49
36
/// <exception cref="ArgumentException"><para><paramref name="entryName"/> is empty.</para>
@@ -53,13 +40,10 @@ public PaxTarEntry(TarEntryType entryType, string entryName)
/// The specified <paramref name="extendedAttributes"/> get appended to the default attributes, unless the specified enumeration overrides any of them.
73
-
/// <para>The following entries are always found in the Extended Attributes dictionary of any PAX entry:</para>
56
+
/// The specified <paramref name="extendedAttributes"/> are additional attributes to be used for the entry.
57
+
/// <para>It may include PAX attributes like:</para>
74
58
/// <list type="bullet">
75
-
/// <item>Modification time, under the name <c>mtime</c>, as a <see cref="double"/> number.</item>
76
59
/// <item>Access time, under the name <c>atime</c>, as a <see cref="double"/> number.</item>
77
60
/// <item>Change time, under the name <c>ctime</c>, as a <see cref="double"/> number.</item>
78
-
/// <item>Path, under the name <c>path</c>, as a string.</item>
79
-
/// </list>
80
-
/// <para>The following entries are only found in the Extended Attributes dictionary of a PAX entry if certain conditions are met:</para>
81
-
/// <list type="bullet">
82
-
/// <item>Group name, under the name <c>gname</c>, as a string, if it is larger than 32 bytes.</item>
83
-
/// <item>User name, under the name <c>uname</c>, as a string, if it is larger than 32 bytes.</item>
84
-
/// <item>File length, under the name <c>size</c>, as an <see cref="int"/>, if the string representation of the number is larger than 12 bytes.</item>
85
61
/// </list>
86
62
/// </remarks>
87
63
/// <exception cref="ArgumentNullException"><paramref name="extendedAttributes"/> or <paramref name="entryName"/> is <see langword="null"/>.</exception>
@@ -94,10 +70,7 @@ public PaxTarEntry(TarEntryType entryType, string entryName, IEnumerable<KeyValu
/// Returns the extended attributes for this entry.
144
112
/// </summary>
145
-
/// <remarks>The extended attributes are specified when constructing an entry. Use <see cref="PaxTarEntry(TarEntryType, string, IEnumerable{KeyValuePair{string, string}})"/> to append your own enumeration of extended attributes to the current entry on top of the default ones. Use <see cref="PaxTarEntry(TarEntryType, string)"/> to only use the default extended attributes.
146
-
/// <para>The following entries are always found in the Extended Attributes dictionary of any PAX entry:</para>
113
+
/// <remarks>The extended attributes are specified when constructing an entry and updated with additional attributes when the entry is written. Use <see cref="PaxTarEntry(TarEntryType, string, IEnumerable{KeyValuePair{string, string}})"/> to append custom extended attributes.
114
+
/// <para>The following common PAX attributes may be included:</para>
147
115
/// <list type="bullet">
148
116
/// <item>Modification time, under the name <c>mtime</c>, as a <see cref="double"/> number.</item>
149
117
/// <item>Access time, under the name <c>atime</c>, as a <see cref="double"/> number.</item>
150
118
/// <item>Change time, under the name <c>ctime</c>, as a <see cref="double"/> number.</item>
151
119
/// <item>Path, under the name <c>path</c>, as a string.</item>
152
-
/// </list>
153
-
/// <para>The following entries are only found in the Extended Attributes dictionary of a PAX entry if certain conditions are met:</para>
154
-
/// <list type="bullet">
155
-
/// <item>Group name, under the name <c>gname</c>, as a string, if it is larger than 32 bytes.</item>
156
-
/// <item>User name, under the name <c>uname</c>, as a string, if it is larger than 32 bytes.</item>
157
-
/// <item>File length, under the name <c>size</c>, as an <see cref="int"/>, if the string representation of the number is larger than 12 bytes.</item>
120
+
/// <item>Group name, under the name <c>gname</c>, as a string.</item>
121
+
/// <item>User name, under the name <c>uname</c>, as a string.</item>
122
+
/// <item>File length, under the name <c>size</c>, as an <see cref="int"/>.</item>
// TODO: Read the bytes of the currently unsupported GNU fields, in case user wants to write this entry into another GNU archive, they need to be preserved. https://github.com/dotnet/runtime/issues/68230
// TODO: Read the bytes of the currently unsupported GNU fields, in case user wants to write this entry into another GNU archive, they need to be preserved. https://github.com/dotnet/runtime/issues/68230
0 commit comments