291 references to TarEntryFormat
Microsoft.Build.Tasks.Core (19)
TarDirectory.cs (19)
89/// This parameter is optional; when empty, <see cref="TarEntryFormat.Pax"/> is used. 92/// This is deliberately typed as <see cref="string"/> rather than <see cref="TarEntryFormat"/>. When .NET 189if (!TryGetEntryFormat(out TarEntryFormat format)) 312/// contents. This mirrors the entry naming of <see cref="TarFile.CreateFromDirectory(string, Stream, bool, TarEntryFormat)"/> 334/// <see cref="TarFile.CreateFromDirectory(string, Stream, bool, TarEntryFormat)"/> and avoiding reparse-point cycles. 419/// Resolves <see cref="Format"/> to a <see cref="TarEntryFormat"/>. An empty value selects the 420/// <see cref="TarEntryFormat.Pax"/> default. 423private bool TryGetEntryFormat(out TarEntryFormat format) 425format = TarEntryFormat.Pax; 432if (!Enum.TryParse(Format, ignoreCase: true, out TarEntryFormat parsed) || !Enum.IsDefined(typeof(TarEntryFormat), parsed)) 439format = parsed == TarEntryFormat.Unknown ? TarEntryFormat.Pax : parsed; 474private static async System.Threading.Tasks.Task WriteStampedEntryAsync(TarWriter writer, TarEntryFormat format, FileSystemInfo info, string entryName, DateTimeOffset timestamp, CancellationToken cancellationToken) 483(_, _, TarEntryFormat.V7) => TarEntryType.V7RegularFile, 522private static TarEntry CreateEntry(TarEntryFormat format, TarEntryType entryType, string entryName) => format switch 524TarEntryFormat.V7 => new V7TarEntry(entryType, entryName), 525TarEntryFormat.Ustar => new UstarTarEntry(entryType, entryName), 526TarEntryFormat.Gnu => new GnuTarEntry(entryType, entryName),
Microsoft.NET.Build.Containers (7)
Layer.cs (1)
106using (TarWriter writer = new(layerStream, TarEntryFormat.Pax, leaveOpen: true))
LocalDaemons\ContainerArchive.cs (3)
61using TarWriter writer = new(imageStream, TarEntryFormat.Pax, leaveOpen: true); 81using TarWriter writer = new(imageStream, TarEntryFormat.Pax, leaveOpen: true); 96using TarWriter writer = new(imageStream, TarEntryFormat.Pax, leaveOpen: true);
LocalDaemons\DockerCli.cs (3)
312using TarWriter writer = new(imageStream, TarEntryFormat.Pax, leaveOpen: true); 419using TarWriter writer = new(imageStream, TarEntryFormat.Pax, leaveOpen: true); 515using TarWriter writer = new(imageStream, TarEntryFormat.Pax, leaveOpen: true);
System.Formats.Tar (265)
System\Formats\Tar\GnuTarEntry.cs (14)
11/// <remarks>Even though the <see cref="TarEntryFormat.Gnu"/> format is not POSIX compatible, it implements and supports the Unix-specific fields that were defined in the POSIX IEEE P1003.1 standard from 1988: <c>devmajor</c>, <c>devminor</c>, <c>gname</c> and <c>uname</c>.</remarks> 16: base(header, readerOfOrigin, TarEntryFormat.Gnu) 26/// <para>When creating an instance of <see cref="GnuTarEntry"/> using this constructor, the <see cref="AccessTime"/> and <see cref="ChangeTime"/> properties are set to <see langword="default" />, which in the entry header <c>atime</c> and <c>ctime</c> fields is written as null bytes. This ensures compatibility with other tools that are unable to read the <c>atime</c> and <c>ctime</c> in <see cref="TarEntryFormat.Gnu"/> entries, as these two fields are not POSIX compatible because other formats expect the <c>prefix</c> field in the same header location where <see cref="TarEntryFormat.Gnu"/> writes <c>atime</c> and <c>ctime</c>.</para> 38: base(entryType, entryName, TarEntryFormat.Gnu, isGea: false) 45/// <para>When creating an instance of <see cref="GnuTarEntry"/> using this constructor, if <paramref name="other"/> is <see cref="TarEntryFormat.Gnu"/> or <see cref="TarEntryFormat.Pax"/>, then the <see cref="AccessTime"/> and <see cref="ChangeTime"/> properties are set to the same values set in <paramref name="other"/>. But if <paramref name="other"/> is of any other format, then <see cref="AccessTime"/> and <see cref="ChangeTime"/> are set to <see langword="default" />, which in the entry header <c>atime</c> and <c>ctime</c> fields is written as null bytes. This ensures compatibility with other tools that are unable to read the <c>atime</c> and <c>ctime</c> in <see cref="TarEntryFormat.Gnu"/> entries, as these two fields are not POSIX compatible because other formats expect the <c>prefix</c> field in the same header location where <see cref="TarEntryFormat.Gnu"/> writes <c>atime</c> and <c>ctime</c>.</para> 51: base(other, TarEntryFormat.Gnu) 72/// <para>Setting the value of this property to a value other than <see langword="default"/> may cause problems with other tools that read TAR files, because the <see cref="TarEntryFormat.Gnu"/> format writes the <c>atime</c> field where other formats would normally read and write the <c>prefix</c> field in the header. You should only set this property to something other than <see langword="default"/> if this entry will be read by tools that know how to correctly interpret the <c>atime</c> field of the <see cref="TarEntryFormat.Gnu"/> format.</para> 88/// <para>Setting the value of this property to a value other than <see langword="default"/> may cause problems with other tools that read TAR files, because the <see cref="TarEntryFormat.Gnu"/> format writes the <c>ctime</c> field where other formats would normally read and write the <c>prefix</c> field in the header. You should only set this property to something other than <see langword="default"/> if this entry will be read by tools that know how to correctly interpret the <c>ctime</c> field of the <see cref="TarEntryFormat.Gnu"/> format.</para>
System\Formats\Tar\PaxGlobalExtendedAttributesTarEntry.cs (2)
16: base(header, readerOfOrigin, TarEntryFormat.Pax) 26: 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
System\Formats\Tar\PaxTarEntry.cs (6)
17: base(header, readerOfOrigin, TarEntryFormat.Pax) 38: base(entryType, entryName, TarEntryFormat.Pax, isGea: false) 67: base(entryType, entryName, TarEntryFormat.Pax, isGea: false) 89: base(other, TarEntryFormat.Pax) 91if (other._header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax)
System\Formats\Tar\PosixTarEntry.cs (11)
9/// Abstract class that represents a tar entry from an archive of a format that is based on the POSIX IEEE P1003.1 standard from 1988. This includes the formats <see cref="TarEntryFormat.Ustar"/> (represented by the <see cref="UstarTarEntry"/> class), <see cref="TarEntryFormat.Pax"/> (represented by the <see cref="PaxTarEntry"/> class) and <see cref="TarEntryFormat.Gnu"/> (represented by the <see cref="GnuTarEntry"/> class). 12/// Even though the <see cref="TarEntryFormat.Gnu"/> format is not POSIX compatible, it implements and supports the Unix-specific fields that were defined in that POSIX standard.</remarks> 16internal PosixTarEntry(TarHeader header, TarReader readerOfOrigin, TarEntryFormat format) 22internal PosixTarEntry(TarEntryType entryType, string entryName, TarEntryFormat format, bool isGea) 32internal PosixTarEntry(TarEntry other, TarEntryFormat format) 53/// <exception cref="ArgumentOutOfRangeException">The value is negative, or larger than 2097151 when using <see cref="TarEntryFormat.V7"/> or <see cref="TarEntryFormat.Ustar"/>.</exception> 80/// <exception cref="ArgumentOutOfRangeException">The value is negative, or larger than 2097151 when using <see cref="TarEntryFormat.V7"/> or <see cref="TarEntryFormat.Ustar"/>.</exception>
System\Formats\Tar\TarEntry.cs (14)
15/// <remarks>All the properties exposed by this class are supported by the <see cref="TarEntryFormat.V7"/>, <see cref="TarEntryFormat.Ustar"/>, <see cref="TarEntryFormat.Pax"/> and <see cref="TarEntryFormat.Gnu"/> formats.</remarks> 24protected bool FormatIsOctalOnly => _header._format is TarEntryFormat.V7 or TarEntryFormat.Ustar; 27internal TarEntry(TarHeader header, TarReader readerOfOrigin, TarEntryFormat format) 37internal TarEntry(TarEntryType entryType, string entryName, TarEntryFormat format, bool isGea) 53internal TarEntry(TarEntry other, TarEntryFormat format) 82public TarEntryFormat Format => _header._format; 102/// <exception cref="ArgumentOutOfRangeException">The specified value is larger than <see cref="DateTimeOffset.UnixEpoch"/> when using <see cref="TarEntryFormat.V7"/> or <see cref="TarEntryFormat.Ustar"/>.</exception> 120/// <remarks>The entry type that commonly contains data is <see cref="TarEntryType.RegularFile"/> (or <see cref="TarEntryType.V7RegularFile"/> in the <see cref="TarEntryFormat.V7"/> format). Other uncommon entry types that can also contain data are: <see cref="TarEntryType.ContiguousFile"/>, <see cref="TarEntryType.DirectoryList"/>, <see cref="TarEntryType.MultiVolume"/> and <see cref="TarEntryType.SparseFile"/>.</remarks> 265/// <exception cref="InvalidOperationException">Setting a data section is not supported because the <see cref="EntryType"/> is not <see cref="TarEntryType.RegularFile"/> (or <see cref="TarEntryType.V7RegularFile"/> for an archive of <see cref="TarEntryFormat.V7"/> format).</exception>
System\Formats\Tar\TarEntryType.cs (10)
14/// <para>This entry type is specific to the <see cref="TarEntryFormat.Ustar"/>, <see cref="TarEntryFormat.Pax"/> and <see cref="TarEntryFormat.Gnu"/> formats.</para> 46/// <para>This entry type is specific to the <see cref="TarEntryFormat.Gnu"/> format, and is treated as a <see cref="RegularFile"/> entry type.</para> 62/// <para>This entry type is specific to the <see cref="TarEntryFormat.Gnu"/> format, and is treated as a <see cref="Directory"/> entry type that contains a data section.</para> 77/// <para>This entry type is specific to the <see cref="TarEntryFormat.Gnu"/> format and is not supported for writing.</para> 82/// <para>This entry type is specific to the <see cref="TarEntryFormat.V7"/> format.</para> 87/// <para>This entry type is specific to the <see cref="TarEntryFormat.Gnu"/> format. It is considered unsafe and is ignored by other tools.</para> 92/// <para>This entry type is specific to the <see cref="TarEntryFormat.Gnu"/> format and is not supported for writing.</para> 97/// <para>This entry type is specific to the <see cref="TarEntryFormat.Gnu"/> format and is not supported for writing.</para>
System\Formats\Tar\TarFile.cs (23)
19/// <inheritdoc cref="CreateFromDirectory(string, Stream, bool, TarEntryFormat)" /> 21=> CreateFromDirectory(sourceDirectoryName, destination, includeBaseDirectory, TarEntryFormat.Pax); 35/// <exception cref="ArgumentOutOfRangeException"><paramref name="format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 37public static void CreateFromDirectory(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, TarEntryFormat format) 55/// <exception cref="ArgumentOutOfRangeException"><see cref="TarWriterOptions.Format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 79/// <inheritdoc cref="CreateFromDirectoryAsync(string, Stream, bool, TarEntryFormat, CancellationToken)" /> 81=> CreateFromDirectoryAsync(sourceDirectoryName, destination, includeBaseDirectory, TarEntryFormat.Pax, cancellationToken); 97/// <exception cref="ArgumentOutOfRangeException"><paramref name="format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 99public static Task CreateFromDirectoryAsync(string sourceDirectoryName, Stream destination, bool includeBaseDirectory, TarEntryFormat format, CancellationToken cancellationToken = default) 119/// <exception cref="ArgumentOutOfRangeException"><see cref="TarWriterOptions.Format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 147/// <inheritdoc cref="CreateFromDirectory(string, string, bool, TarEntryFormat)" /> 149=> CreateFromDirectory(sourceDirectoryName, destinationFileName, includeBaseDirectory, TarEntryFormat.Pax); 161/// <exception cref="ArgumentOutOfRangeException"><paramref name="format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 163public static void CreateFromDirectory(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, TarEntryFormat format) 179/// <exception cref="ArgumentOutOfRangeException"><see cref="TarWriterOptions.Format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 202/// <inheritdoc cref="CreateFromDirectoryAsync(string, string, bool, TarEntryFormat, CancellationToken)" /> 204=> CreateFromDirectoryAsync(sourceDirectoryName, destinationFileName, includeBaseDirectory, TarEntryFormat.Pax, cancellationToken); 218/// <exception cref="ArgumentOutOfRangeException"><paramref name="format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 220public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationFileName, bool includeBaseDirectory, TarEntryFormat format, CancellationToken cancellationToken = default) 238/// <exception cref="ArgumentOutOfRangeException"><see cref="TarWriterOptions.Format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 738private static void ValidateFormat(TarEntryFormat format) 740if (format is < TarEntryFormat.V7 or > TarEntryFormat.Gnu)
System\Formats\Tar\TarHeader.cs (14)
57internal TarEntryFormat _format; 110internal TarHeader(TarEntryFormat format, string name = "", int mode = 0, DateTimeOffset mTime = default, TarEntryType typeFlag = TarEntryType.RegularFile) 124internal TarHeader(TarEntryFormat format, TarEntryType typeFlag, TarHeader other) 167private static string GetMagicForFormat(TarEntryFormat format) => format switch 169TarEntryFormat.Ustar or TarEntryFormat.Pax => UstarMagic, 170TarEntryFormat.Gnu => GnuMagic, 174private static string GetVersionForFormat(TarEntryFormat format) => format switch 176TarEntryFormat.Ustar or TarEntryFormat.Pax => UstarVersion, 177TarEntryFormat.Gnu => GnuVersion, 192if (_format == TarEntryFormat.Pax && _ea is not null) 209if (_format == TarEntryFormat.Pax && _ea is not null) 221if (_format == TarEntryFormat.Pax && _ea is not null)
System\Formats\Tar\TarHeader.Read.cs (24)
22internal static async ValueTask<TarHeader?> TryGetNextHeaderCoreAsync<TAdapter>(Stream archiveStream, bool copyData, TarEntryFormat initialFormat, bool processDataBlock, CancellationToken cancellationToken) 46private static TarHeader? TryReadAttributes(TarEntryFormat initialFormat, ReadOnlySpan<byte> buffer, Stream archiveStream) 55if (header._format != TarEntryFormat.V7) 63Debug.Assert(header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax or TarEntryFormat.Gnu); 64if (header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax) 74else if (header._format == TarEntryFormat.Gnu) 404private static TarHeader? TryReadCommonAttributes(ReadOnlySpan<byte> buffer, TarEntryFormat initialFormat) 461if (header._format == TarEntryFormat.Unknown) 466TarEntryType.GlobalExtendedAttributes => TarEntryFormat.Pax, 473TarEntryType.TapeVolume => TarEntryFormat.Gnu, 476TarEntryType.V7RegularFile => TarEntryFormat.V7, 482_ => (header._typeFlag == TarEntryType.RegularFile) ? TarEntryFormat.Ustar : TarEntryFormat.V7 516_format = TarEntryFormat.V7; 524_format = TarEntryFormat.Gnu; 529if (_format == TarEntryFormat.V7) 532_format = TarEntryFormat.Ustar; 545if (_format == TarEntryFormat.V7) 553case TarEntryFormat.Ustar or TarEntryFormat.Pax: 571case TarEntryFormat.Gnu:
System\Formats\Tar\TarHeader.Write.cs (59)
36private void WriteWithSeekableDataStream(TarEntryFormat format, Stream archiveStream, Span<byte> buffer) 38Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 52private async ValueTask WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat format, Stream archiveStream, Memory<byte> buffer, CancellationToken cancellationToken) 55Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 68private void WriteWithUnseekableDataStream(TarEntryFormat format, Stream destinationStream, Span<byte> buffer, bool shouldAdvanceToEnd) 78TarEntryFormat.V7 => FieldLocations.V7Data, 79TarEntryFormat.Ustar or TarEntryFormat.Pax => FieldLocations.PosixData, 80TarEntryFormat.Gnu => FieldLocations.GnuData, 107private async ValueTask WriteWithUnseekableDataStreamCoreAsync<TAdapter>(TarEntryFormat format, Stream destinationStream, Memory<byte> buffer, bool shouldAdvanceToEnd, CancellationToken cancellationToken) 120TarEntryFormat.V7 => FieldLocations.V7Data, 121TarEntryFormat.Ustar or TarEntryFormat.Pax => FieldLocations.PosixData, 122TarEntryFormat.Gnu => FieldLocations.GnuData, 162TarEntryType actualEntryType = TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.V7, _typeFlag); 172TarEntryType actualEntryType = TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.Ustar, _typeFlag); 209WriteWithUnseekableDataStream(TarEntryFormat.V7, archiveStream, buffer, shouldAdvanceToEnd: true); 213WriteWithSeekableDataStream(TarEntryFormat.V7, archiveStream, buffer); 224return WriteWithUnseekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.V7, archiveStream, buffer, shouldAdvanceToEnd: true, cancellationToken); 228return WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.V7, archiveStream, buffer, cancellationToken); 237WriteWithUnseekableDataStream(TarEntryFormat.Ustar, archiveStream, buffer, shouldAdvanceToEnd: true); 241WriteWithSeekableDataStream(TarEntryFormat.Ustar, archiveStream, buffer); 252return WriteWithUnseekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Ustar, archiveStream, buffer, shouldAdvanceToEnd: true, cancellationToken); 256return WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Ustar, archiveStream, buffer, cancellationToken); 266TarHeader extendedAttributesHeader = new(TarEntryFormat.Pax); 271WriteWithUnseekableDataStream(TarEntryFormat.Pax, tempStream, buffer, shouldAdvanceToEnd: false); 288WriteWithSeekableDataStream(TarEntryFormat.Pax, archiveStream, buffer); 299TarHeader extendedAttributesHeader = new(TarEntryFormat.Pax); 306await WriteWithUnseekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Pax, tempStream, buffer, shouldAdvanceToEnd: false, cancellationToken).ConfigureAwait(false); 330await WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Pax, archiveStream, buffer, cancellationToken).ConfigureAwait(false); 351longLinkHeader.WriteWithSeekableDataStream(TarEntryFormat.Gnu, archiveStream, buffer); 359longPathHeader.WriteWithSeekableDataStream(TarEntryFormat.Gnu, archiveStream, buffer); 365WriteWithUnseekableDataStream(TarEntryFormat.Gnu, archiveStream, buffer, shouldAdvanceToEnd: true); 369WriteWithSeekableDataStream(TarEntryFormat.Gnu, archiveStream, buffer); 383await longLinkHeader.WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Gnu, archiveStream, buffer, cancellationToken).ConfigureAwait(false); 392await longPathHeader.WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Gnu, archiveStream, buffer, cancellationToken).ConfigureAwait(false); 399await WriteWithUnseekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Gnu, archiveStream, buffer, shouldAdvanceToEnd: true, cancellationToken).ConfigureAwait(false); 403await WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Gnu, archiveStream, buffer, cancellationToken).ConfigureAwait(false); 432return new(TarEntryFormat.Gnu) 452tmpChecksum += WriteCommonFields(buffer, TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.Gnu, _typeFlag)); 465WriteWithSeekableDataStream(TarEntryFormat.Pax, archiveStream, buffer); 473return WriteWithSeekableDataStreamCoreAsync<TAdapter>(TarEntryFormat.Pax, archiveStream, buffer, cancellationToken); 494tmpChecksum += WriteCommonFields(buffer, TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.Pax, _typeFlag)); 502private void WriteFieldsToBuffer(TarEntryFormat format, Span<byte> buffer) 506case TarEntryFormat.V7: 509case TarEntryFormat.Ustar: 512case TarEntryFormat.Pax: 515case TarEntryFormat.Gnu: 530if (_format is TarEntryFormat.V7) 650if (_format is not TarEntryFormat.Pax and not TarEntryFormat.Gnu) 708if (_format is not TarEntryFormat.Pax) 726if (_format is not TarEntryFormat.Pax) 1039if (isOctalRange || _format == TarEntryFormat.Pax) 1043else if (_format == TarEntryFormat.Gnu) 1065if (isOctalRange || _format == TarEntryFormat.Pax) 1069else if (_format == TarEntryFormat.Gnu)
System\Formats\Tar\TarHelpers.cs (10)
198internal static TarEntryType GetRegularFileEntryTypeForFormat(TarEntryFormat format) => format is TarEntryFormat.V7 ? TarEntryType.V7RegularFile : TarEntryType.RegularFile; 203internal static TarEntryType GetCorrectTypeFlagForFormat(TarEntryFormat format, TarEntryType entryType) 205if (format is TarEntryFormat.V7) 305internal static void ThrowIfEntryTypeNotSupported(TarEntryType entryType, TarEntryFormat archiveFormat, [CallerArgumentExpression(nameof(entryType))] string? paramName = null) 309case TarEntryFormat.V7: 320case TarEntryFormat.Ustar: 334case TarEntryFormat.Pax: 352case TarEntryFormat.Gnu: 377case TarEntryFormat.Unknown:
System\Formats\Tar\TarReader.cs (13)
99/// <para>More than one Global Extended Attributes Entry was found in the current <see cref="TarEntryFormat.Pax"/> archive.</para> 101/// <para>Two or more Extended Attributes entries were found consecutively in the current <see cref="TarEntryFormat.Pax"/> archive.</para></exception> 136/// <para>More than one Global Extended Attributes Entry was found in the current <see cref="TarEntryFormat.Pax"/> archive.</para> 138/// <para>Two or more Extended Attributes entries were found consecutively in the current <see cref="TarEntryFormat.Pax"/> archive.</para></exception> 218TarEntryFormat.Pax => header._typeFlag is TarEntryType.GlobalExtendedAttributes ? 220TarEntryFormat.Gnu => new GnuTarEntry(header, this), 221TarEntryFormat.Ustar => new UstarTarEntry(header, this), 222TarEntryFormat.V7 or TarEntryFormat.Unknown or _ => new V7TarEntry(header, this), 249TarHeader? header = await TarHeader.TryGetNextHeaderCoreAsync<TAdapter>(_archiveStream, copyData, TarEntryFormat.Unknown, processDataBlock: true, cancellationToken).ConfigureAwait(false); 288TarHeader? actualHeader = await TarHeader.TryGetNextHeaderCoreAsync<TAdapter>(_archiveStream, copyData, TarEntryFormat.Pax, processDataBlock: false, cancellationToken).ConfigureAwait(false); 318TarHeader? secondHeader = await TarHeader.TryGetNextHeaderCoreAsync<TAdapter>(_archiveStream, copyData, TarEntryFormat.Gnu, processDataBlock: true, cancellationToken).ConfigureAwait(false); 337TarHeader? thirdHeader = await TarHeader.TryGetNextHeaderCoreAsync<TAdapter>(_archiveStream, copyData, TarEntryFormat.Gnu, processDataBlock: true, cancellationToken).ConfigureAwait(false);
System\Formats\Tar\TarWriter.cs (45)
28/// <remarks>When using this constructor, <see cref="TarEntryFormat.Pax"/> is used as the default format of the entries written to the archive using the <see cref="WriteEntry(string, string?)"/> method.</remarks> 31/// <remarks>The <see cref="TarEntryFormat.Pax"/> format is the default format as it is the most flexible and POSIX compatible. This is the only format with which <see cref="TarWriter"/> reads and stores <c>atime</c> and <c>ctime</c> when creating entries from filesystem entries.</remarks> 33: this(archiveStream, TarEntryFormat.Pax, leaveOpen: false) 38/// Initializes a <see cref="TarWriter"/> instance that can write tar entries to the specified stream and optionally leaves the stream open upon disposal of this instance. When using this constructor, the format of the resulting archive is <see cref="TarEntryFormat.Pax"/>. 44/// <remarks>The <see cref="TarEntryFormat.Pax"/> format is the default format as it is the most flexible and POSIX compatible. This is the only format with which <see cref="TarWriter"/> reads and stores <c>atime</c> and <c>ctime</c> when creating entries from filesystem entries.</remarks> 46: this(archiveStream, TarEntryFormat.Pax, leaveOpen) 55/// <param name="format">The format to use when calling <see cref="WriteEntry(string, string?)"/>. The default value is <see cref="TarEntryFormat.Pax"/>.</param> 58/// <remarks>The recommended format is <see cref="TarEntryFormat.Pax"/> for its flexibility.</remarks> 61/// <exception cref="ArgumentOutOfRangeException"><paramref name="format"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 62/// <remarks>The <see cref="TarEntryFormat.Pax"/> format is the default for the other <see cref="TarWriter"/> constructors. This is the recommended format as it is the most flexible and POSIX compatible. This is the only format with which <see cref="TarWriter"/> reads and stores <c>atime</c> and <c>ctime</c> when creating entries from filesystem entries.</remarks> 63public TarWriter(Stream archiveStream, TarEntryFormat format = TarEntryFormat.Pax, bool leaveOpen = false) 68private static TarWriterOptions CreateOptionsForFormat(TarEntryFormat format) 70if (format is not TarEntryFormat.V7 and not TarEntryFormat.Ustar and not TarEntryFormat.Pax and not TarEntryFormat.Gnu) 110public TarEntryFormat Format { get; } 155/// <para>The entry will be created using the format specified in the <see cref="TarWriter(Stream, TarEntryFormat, bool)"/> constructor, or will use <see cref="TarEntryFormat.Pax"/> if other constructors are used.</para> 156/// <para>If the format is <see cref="TarEntryFormat.Pax"/>, the <c>atime</c> and <c>ctime</c> from the file will be stored in the <see cref="PaxTarEntry.ExtendedAttributes"/> dictionary. If the format is <see cref="TarEntryFormat.Gnu"/>, this method will not set a value for <see cref="GnuTarEntry.AccessTime"/> and <see cref="GnuTarEntry.ChangeTime"/> because most TAR tools do not support these fields for this format.</para> 177/// <para>The entry will be created using the format specified in the <see cref="TarWriter(Stream, TarEntryFormat, bool)"/> constructor, or will use <see cref="TarEntryFormat.Pax"/> if other constructors are used.</para> 178/// <para>If the format is <see cref="TarEntryFormat.Pax"/>, the <c>atime</c> and <c>ctime</c> from the file will be stored in the <see cref="PaxTarEntry.ExtendedAttributes"/> dictionary. If the format is <see cref="TarEntryFormat.Gnu"/>, this method will not set a value for <see cref="GnuTarEntry.AccessTime"/> and <see cref="GnuTarEntry.ChangeTime"/> because most TAR tools do not support these fields for this format.</para> 214/// <para><see cref="TarEntryFormat.V7"/></para> 223/// <para><see cref="TarEntryFormat.Ustar"/>, <see cref="TarEntryFormat.Pax"/> and <see cref="TarEntryFormat.Gnu"/></para> 242/// <para>To ensure an entry preserves the <c>atime</c> and <c>ctime</c> values and it is readable by other tools, it is recommended to convert the entry to <see cref="PaxTarEntry"/> instead. In that format, the two values get stored in the <see cref="PaxTarEntry.ExtendedAttributes"/>. The <see cref="TarEntryFormat.Pax"/> format is used as the default format by <see cref="TarWriter"/> as it is the most flexible and POSIX compatible.</para> 262/// <para><see cref="TarEntryFormat.V7"/></para> 271/// <para><see cref="TarEntryFormat.Ustar"/>, <see cref="TarEntryFormat.Pax"/> and <see cref="TarEntryFormat.Gnu"/></para> 309case TarEntryFormat.V7: 313case TarEntryFormat.Ustar: 317case TarEntryFormat.Pax: 328case TarEntryFormat.Gnu: 333Debug.Assert(entry.Format == TarEntryFormat.Unknown, "Missing format handler"); 351TarEntryFormat.V7 => entry._header.WriteAsV7CoreAsync<TAdapter>(_archiveStream, buffer, cancellationToken), 352TarEntryFormat.Ustar => entry._header.WriteAsUstarCoreAsync<TAdapter>(_archiveStream, buffer, cancellationToken), 353TarEntryFormat.Pax when entry._header._typeFlag is TarEntryType.GlobalExtendedAttributes => entry._header.WriteAsPaxGlobalExtendedAttributesCoreAsync<TAdapter>(_archiveStream, buffer, _nextGlobalExtendedAttributesEntryNumber++, cancellationToken), 354TarEntryFormat.Pax => entry._header.WriteAsPaxCoreAsync<TAdapter>(_archiveStream, buffer, cancellationToken), 355TarEntryFormat.Gnu => entry._header.WriteAsGnuCoreAsync<TAdapter>(_archiveStream, buffer, cancellationToken),
System\Formats\Tar\TarWriter.Unix.cs (4)
67TarEntryFormat.V7 => new V7TarEntry(entryType, entryName), 68TarEntryFormat.Ustar => new UstarTarEntry(entryType, entryName), 69TarEntryFormat.Pax => new PaxTarEntry(entryType, entryName), 70TarEntryFormat.Gnu => new GnuTarEntry(entryType, entryName),
System\Formats\Tar\TarWriterOptions.cs (8)
14/// <value>The default value is <see cref="TarEntryFormat.Pax"/>.</value> 15/// <exception cref="ArgumentOutOfRangeException"><paramref name="value"/> is either <see cref="TarEntryFormat.Unknown"/>, or not one of the other enum values.</exception> 16public TarEntryFormat Format 21if (value is not TarEntryFormat.V7 and not TarEntryFormat.Ustar and not TarEntryFormat.Pax and not TarEntryFormat.Gnu) 27} = TarEntryFormat.Pax;
System\Formats\Tar\UstarTarEntry.cs (5)
13: base(header, readerOfOrigin, TarEntryFormat.Ustar) 33: base(entryType, entryName, TarEntryFormat.Ustar, isGea: false) 45: base(other, TarEntryFormat.Ustar) 47if (other._header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax)
System\Formats\Tar\V7TarEntry.cs (3)
13: base(header, readerOfOrigin, TarEntryFormat.V7) 28: base(entryType, entryName, TarEntryFormat.V7, isGea: false) 39: base(other, TarEntryFormat.V7)