Clean up TarHeader.GlobalHeadFormatPrefix#77580
Merged
adamsitnik merged 1 commit intodotnet:mainfrom Oct 28, 2022
Merged
Conversation
|
Tagging subscribers to this area: @dotnet/area-system-io |
carlossanlop
approved these changes
Oct 28, 2022
| return result; | ||
| string result = $"{tmp}/GlobalHead.{Environment.ProcessId}.{globalExtendedAttributesEntryNumber}"; | ||
| return result.Length >= FieldLengths.Name ? | ||
| string.Concat("/tmp", result.AsSpan(tmp.Length)) : |
Contributor
There was a problem hiding this comment.
Clever way of replacing the tmp path!
| // Format: "%d/GlobalHead.%p.%n" | ||
| // - %d: The path of the $TMPDIR variable, if found. Otherwise, the value is '/tmp'. | ||
| // - %p: The current process ID. | ||
| // - %n: The sequence number of the global extended header record of the archive, starting at 1. In our case, since we only generate one, the value is always 1. |
Contributor
There was a problem hiding this comment.
Thanks for removing. Remnant from before we approved the class to describe PAX GEA entries.
| /// <exception cref="ArgumentNullException"><paramref name="globalExtendedAttributes"/> is <see langword="null"/>.</exception> | ||
| public PaxGlobalExtendedAttributesTarEntry(IEnumerable<KeyValuePair<string, string>> globalExtendedAttributes) | ||
| : base(TarEntryType.GlobalExtendedAttributes, TarHeader.GlobalHeadFormatPrefix, TarEntryFormat.Pax, isGea: true) | ||
| : 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 |
adamsitnik
approved these changes
Oct 28, 2022
Member
adamsitnik
left a comment
There was a problem hiding this comment.
LGTM, thank you @stephentoub !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #77555