3 writes to _header
System.Formats.Tar (3)
System\Formats\Tar\TarEntry.cs (3)
32_header = header; 49_header = new TarHeader(format, entryName, TarHelpers.GetDefaultMode(entryType), DateTimeOffset.UtcNow, entryType); 66_header = new TarHeader(format, compatibleEntryType, other._header);
133 references to _header
System.Formats.Tar (133)
System\Formats\Tar\GnuTarEntry.cs (8)
57_header._aTime = gnuOther.AccessTime; 58_header._cTime = gnuOther.ChangeTime; 62Debug.Assert(_header._aTime == default); 63Debug.Assert(_header._cTime == default); 76get => _header._aTime; 79_header._aTime = value; 92get => _header._cTime; 95_header._cTime = value;
System\Formats\Tar\PaxGlobalExtendedAttributesTarEntry.cs (2)
29_header.AddExtendedAttributes(globalExtendedAttributes); 35public IReadOnlyDictionary<string, string> GlobalExtendedAttributes => field ??= _header.ExtendedAttributes.AsReadOnly();
System\Formats\Tar\PaxTarEntry.cs (12)
40_header._prefix = string.Empty; 71_header._prefix = string.Empty; 72_header.ReplaceNormalAttributesWithExtended(extendedAttributes); 75_header._name = entryName; 76_header.ExtendedAttributes[TarHeader.PaxEaName] = entryName; 91if (other._header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax) 93_header._prefix = other._header._prefix; 98_header.ReplaceNormalAttributesWithExtended(paxOther.ExtendedAttributes); 104_header.ExtendedAttributes[TarHeader.PaxEaATime] = TarHelpers.GetTimestampStringFromDateTimeOffset(gnuOther.AccessTime); 108_header.ExtendedAttributes[TarHeader.PaxEaCTime] = TarHelpers.GetTimestampStringFromDateTimeOffset(gnuOther.ChangeTime); 129public IReadOnlyDictionary<string, string> ExtendedAttributes => field ??= _header.GetPopulatedExtendedAttributes().AsReadOnly();
System\Formats\Tar\PosixTarEntry.cs (30)
25_header._uName = string.Empty; 26_header._gName = string.Empty; 27_header._devMajor = 0; 28_header._devMinor = 0; 37Debug.Assert(other._header._uName != null); 38Debug.Assert(other._header._gName != null); 39_header._uName = other._header._uName; 40_header._gName = other._header._gName; 41_header._devMajor = other._header._devMajor; 42_header._devMinor = other._header._devMinor; 44_header._uName ??= string.Empty; 45_header._gName ??= string.Empty; 56get => _header._devMajor; 59if (_header._typeFlag is not TarEntryType.BlockDevice and not TarEntryType.CharacterDevice) 70_header._devMajor = value; 71_header.SyncNumericExtendedAttribute(TarHeader.PaxEaDevMajor, value, TarHeader.Octal8ByteFieldMaxValue); 83get => _header._devMinor; 86if (_header._typeFlag is not TarEntryType.BlockDevice and not TarEntryType.CharacterDevice) 97_header._devMinor = value; 98_header.SyncNumericExtendedAttribute(TarHeader.PaxEaDevMinor, value, TarHeader.Octal8ByteFieldMaxValue); 109get => _header._gName ?? string.Empty; 113_header._gName = value; 114_header.SyncStringExtendedAttribute(TarHeader.PaxEaGName, value, FieldLengths.GName); 125get => _header._uName ?? string.Empty; 129_header._uName = value; 130_header.SyncStringExtendedAttribute(TarHeader.PaxEaUName, value, FieldLengths.UName);
System\Formats\Tar\TarEntry.cs (30)
24protected bool FormatIsOctalOnly => _header._format is TarEntryFormat.V7 or TarEntryFormat.Ustar; 66_header = new TarHeader(format, compatibleEntryType, other._header); 72public int Checksum => _header._checksum; 77public TarEntryType EntryType => _header._typeFlag; 82public TarEntryFormat Format => _header._format; 90get => _header._gid; 93_header._gid = value; 94_header.SyncNumericExtendedAttribute(TarHeader.PaxEaGid, value, TarHeader.Octal8ByteFieldMaxValue); 105get => _header._mTime; 112_header._mTime = value; 113_header.SyncTimestampExtendedAttribute(TarHeader.PaxEaMTime, value); 121public long Length => _header._dataStream != null ? _header._dataStream.Length : _header._size; 132get => _header._linkName ?? string.Empty; 135if (_header._typeFlag is not TarEntryType.HardLink and not TarEntryType.SymbolicLink) 140_header._linkName = value; 141_header.SyncStringExtendedAttribute(TarHeader.PaxEaLinkName, value); 153get => (UnixFileMode)(_header._mode & (int)TarHelpers.ValidUnixFileModes); 160_header._mode = (int)value; 170get => _header._name; 174_header._name = value; 175_header.SyncStringExtendedAttribute(TarHeader.PaxEaName, value); 185get => _header._uid; 188_header._uid = value; 189_header.SyncNumericExtendedAttribute(TarHeader.PaxEaUid, value, TarHeader.Octal8ByteFieldMaxValue); 270get => _header._dataStream; 293_header._dataStream?.Dispose(); 295_header._dataStream = value; 306public long DataOffset => _header._dataOffset;
System\Formats\Tar\TarEntry.Unix.cs (4)
17Interop.CheckIo(Interop.Sys.CreateBlockDevice(destinationFileName, (uint)Mode, (uint)_header._devMajor, (uint)_header._devMinor), destinationFileName); 24Interop.CheckIo(Interop.Sys.CreateCharacterDevice(destinationFileName, (uint)Mode, (uint)_header._devMajor, (uint)_header._devMinor), destinationFileName);
System\Formats\Tar\TarReader.cs (11)
209Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 210_archiveStream.Position = _previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment; 212else if (_previouslyReadEntry._header._size > 0) 219if (_previouslyReadEntry._header._dataStream is not SubReadStream dataStream) 226TarHelpers.SkipBlockAlignmentPadding(_archiveStream, _previouslyReadEntry._header._size); 242Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 243_archiveStream.Position = _previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment; 245else if (_previouslyReadEntry._header._size > 0) 252if (_previouslyReadEntry._header._dataStream is not SubReadStream dataStream) 259await TarHelpers.SkipBlockAlignmentPaddingAsync(_archiveStream, _previouslyReadEntry._header._size, cancellationToken).ConfigureAwait(false); 604if (entry._header._dataStream is SubReadStream dataStream)
System\Formats\Tar\TarWriter.cs (21)
203entry._header._dataStream?.Dispose(); 214if (entry._header._dataStream != null) 216await entry._header._dataStream.DisposeAsync().ConfigureAwait(false); 262ValidateEntryLinkName(entry._header._typeFlag, entry._header._linkName); 311ValidateEntryLinkName(entry._header._typeFlag, entry._header._linkName); 325entry._header.WriteAsV7(_archiveStream, buffer); 329entry._header.WriteAsUstar(_archiveStream, buffer); 333if (entry._header._typeFlag is TarEntryType.GlobalExtendedAttributes) 335entry._header.WriteAsPaxGlobalExtendedAttributes(_archiveStream, buffer, _nextGlobalExtendedAttributesEntryNumber++); 339entry._header.WriteAsPax(_archiveStream, buffer); 344entry._header.WriteAsGnu(_archiveStream, buffer); 366TarEntryFormat.V7 => entry._header.WriteAsV7Async(_archiveStream, buffer, cancellationToken), 367TarEntryFormat.Ustar => entry._header.WriteAsUstarAsync(_archiveStream, buffer, cancellationToken), 368TarEntryFormat.Pax when entry._header._typeFlag is TarEntryType.GlobalExtendedAttributes => entry._header.WriteAsPaxGlobalExtendedAttributesAsync(_archiveStream, buffer, _nextGlobalExtendedAttributesEntryNumber++, cancellationToken), 369TarEntryFormat.Pax => entry._header.WriteAsPaxAsync(_archiveStream, buffer, cancellationToken), 370TarEntryFormat.Gnu => entry._header.WriteAsGnuAsync(_archiveStream, buffer, cancellationToken), 419if (!_archiveStream.CanSeek && entry._header._dataStream != null && !entry._header._dataStream.CanSeek)
System\Formats\Tar\TarWriter.Unix.cs (10)
83entry._header._devMajor = (int)major; 84entry._header._devMinor = (int)minor; 87entry._header._mTime = TarHelpers.GetDateTimeOffsetFromSecondsSinceEpoch(status.MTime); 95entry._header._mode = status.Mode & (int)TarHelpers.ValidUnixFileModes; 98entry._header._uid = (int)status.Uid; 104entry._header._uName = uName; 107entry._header._gid = (int)status.Gid; 115entry._header._gName = gName; 130Debug.Assert(entry._header._dataStream == null); 131entry._header._dataStream = new FileStream(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, fileOptions);
System\Formats\Tar\UstarTarEntry.cs (5)
35_header._prefix = string.Empty; 47if (other._header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax) 49_header._prefix = other._header._prefix; 53_header._prefix = string.Empty;