80 references to TarHelpers
System.Formats.Tar (80)
System\Formats\Tar\PaxTarEntry.cs (2)
104
_header.ExtendedAttributes[TarHeader.PaxEaATime] =
TarHelpers
.GetTimestampStringFromDateTimeOffset(gnuOther.AccessTime);
108
_header.ExtendedAttributes[TarHeader.PaxEaCTime] =
TarHelpers
.GetTimestampStringFromDateTimeOffset(gnuOther.ChangeTime);
System\Formats\Tar\SubReadStream.cs (2)
77
return
TarHelpers
.AdvanceStreamAsync(_superStream, remaining, cancellationToken);
86
TarHelpers
.AdvanceStream(_superStream, remaining);
System\Formats\Tar\TarEntry.cs (12)
45
TarHelpers
.ThrowIfEntryTypeNotSupported(entryType, format);
49
_header = new TarHeader(format, entryName,
TarHelpers
.GetDefaultMode(entryType), DateTimeOffset.UtcNow, entryType);
60
TarEntryType compatibleEntryType =
TarHelpers
.GetCorrectTypeFlagForFormat(format, other.EntryType);
62
TarHelpers
.ThrowIfEntryTypeNotSupported(compatibleEntryType, format, nameof(other));
153
get => (UnixFileMode)(_header._mode & (int)
TarHelpers
.ValidUnixFileModes);
156
if ((value & ~
TarHelpers
.ValidUnixFileModes) != 0) // throw on invalid UnixFileModes
324
TarHelpers
.CreateDirectory(destinationFullPath, Mode, pendingModes);
325
TarHelpers
.UpdatePendingModificationTimes(directoryModificationTimes, destinationFullPath, ModificationTime);
330
TarHelpers
.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes);
347
TarHelpers
.CreateDirectory(destinationFullPath, Mode, pendingModes);
348
TarHelpers
.UpdatePendingModificationTimes(directoryModificationTimes, destinationFullPath, ModificationTime);
354
TarHelpers
.CreateDirectory(Path.GetDirectoryName(destinationFullPath)!, mode: null, pendingModes);
System\Formats\Tar\TarFile.cs (6)
657
SortedDictionary<string, UnixFileMode>? pendingModes =
TarHelpers
.CreatePendingModesDictionary();
667
TarHelpers
.SetPendingModes(pendingModes);
668
TarHelpers
.SetPendingModificationTimes(directoryModificationTimes);
702
SortedDictionary<string, UnixFileMode>? pendingModes =
TarHelpers
.CreatePendingModesDictionary();
716
TarHelpers
.SetPendingModes(pendingModes);
717
TarHelpers
.SetPendingModificationTimes(directoryModificationTimes);
System\Formats\Tar\TarHeader.cs (2)
181
_ea[key] =
TarHelpers
.GetTimestampStringFromDateTimeOffset(value);
225
ea[PaxEaMTime] =
TarHelpers
.GetTimestampStringFromDateTimeOffset(_mTime);
System\Formats\Tar\TarHeader.Read.cs (34)
25
Span<byte> buffer = stackalloc byte[
TarHelpers
.RecordSize];
46
byte[] rented = ArrayPool<byte>.Shared.Rent(minimumLength:
TarHelpers
.RecordSize);
47
Memory<byte> buffer = rented.AsMemory(0,
TarHelpers
.RecordSize); // minimumLength means the array could've been larger
140
if (
TarHelpers
.TryGetDateTimeOffsetFromTimestampString(ExtendedAttributes, PaxEaMTime, out DateTimeOffset mTime))
146
if (
TarHelpers
.TryGetStringAsBaseTenInteger(ExtendedAttributes, PaxEaMode, out int mode))
152
if (
TarHelpers
.TryGetStringAsBaseTenLong(ExtendedAttributes, PaxEaSize, out long size))
158
if (
TarHelpers
.TryGetStringAsBaseTenInteger(ExtendedAttributes, PaxEaUid, out int uid))
164
if (
TarHelpers
.TryGetStringAsBaseTenInteger(ExtendedAttributes, PaxEaGid, out int gid))
182
if (
TarHelpers
.TryGetStringAsBaseTenInteger(ExtendedAttributes, PaxEaDevMajor, out int devMajor))
188
if (
TarHelpers
.TryGetStringAsBaseTenInteger(ExtendedAttributes, PaxEaDevMinor, out int devMinor))
235
TarHelpers
.AdvanceStream(archiveStream, _size);
251
TarHelpers
.SkipBlockAlignmentPadding(archiveStream, _size);
297
await
TarHelpers
.AdvanceStreamAsync(archiveStream, _size, cancellationToken).ConfigureAwait(false);
313
await
TarHelpers
.SkipBlockAlignmentPaddingAsync(archiveStream, _size, cancellationToken).ConfigureAwait(false);
337
TarHelpers
.CopyBytes(archiveStream, copiedData, _size);
364
await
TarHelpers
.CopyBytesAsync(archiveStream, copiedData, size, cancellationToken).ConfigureAwait(false);
384
if (
TarHelpers
.IsAllNullBytes(spanChecksum))
392
checksum = (int)
TarHelpers
.ParseOctal<uint>(spanChecksum);
415
long size =
TarHelpers
.ParseNumeric<long>(buffer.Slice(FieldLocations.Size, FieldLengths.Size));
423
name:
TarHelpers
.ParseUtf8String(buffer.Slice(FieldLocations.Name, FieldLengths.Name)),
424
mode:
TarHelpers
.ParseNumeric<int>(buffer.Slice(FieldLocations.Mode, FieldLengths.Mode)),
430
_uid =
TarHelpers
.ParseNumeric<int>(buffer.Slice(FieldLocations.Uid, FieldLengths.Uid)),
431
_gid =
TarHelpers
.ParseNumeric<int>(buffer.Slice(FieldLocations.Gid, FieldLengths.Gid)),
432
_linkName =
TarHelpers
.ParseUtf8String(buffer.Slice(FieldLocations.LinkName, FieldLengths.LinkName))
476
calculatedChecksum += Checksum(buffer.Slice(FieldLocations.Checksum + FieldLengths.Checksum,
TarHelpers
.RecordSize - (FieldLocations.Checksum + FieldLengths.Checksum)));
488
if (
TarHelpers
.IsAllNullBytes(magic))
574
_uName =
TarHelpers
.ParseUtf8String(buffer.Slice(FieldLocations.UName, FieldLengths.UName));
575
_gName =
TarHelpers
.ParseUtf8String(buffer.Slice(FieldLocations.GName, FieldLengths.GName));
582
_devMajor =
TarHelpers
.ParseNumeric<int>(buffer.Slice(FieldLocations.DevMajor, FieldLengths.DevMajor));
585
_devMinor =
TarHelpers
.ParseNumeric<int>(buffer.Slice(FieldLocations.DevMinor, FieldLengths.DevMinor));
609
long time =
TarHelpers
.ParseNumeric<long>(buffer);
610
return
TarHelpers
.GetDateTimeOffsetFromSecondsSinceEpoch(time);
617
_prefix =
TarHelpers
.ParseUtf8String(buffer.Slice(FieldLocations.Prefix, FieldLengths.Prefix));
751
string longPath =
TarHelpers
.ParseUtf8String(buffer);
System\Formats\Tar\TarHeader.Write.cs (12)
175
TarEntryType actualEntryType =
TarHelpers
.GetCorrectTypeFlagForFormat(TarEntryFormat.V7, _typeFlag);
185
TarEntryType actualEntryType =
TarHelpers
.GetCorrectTypeFlagForFormat(TarEntryFormat.Ustar, _typeFlag);
468
_mode =
TarHelpers
.GetDefaultMode(entryType),
485
tmpChecksum += WriteCommonFields(buffer,
TarHelpers
.GetCorrectTypeFlagForFormat(TarEntryFormat.Gnu, _typeFlag));
520
_mode =
TarHelpers
.GetDefaultMode(_typeFlag);
528
tmpChecksum += WriteCommonFields(buffer,
TarHelpers
.GetCorrectTypeFlagForFormat(TarEntryFormat.Pax, _typeFlag));
812
int paddingAfterData =
TarHelpers
.CalculatePadding(_size);
815
Debug.Assert(paddingAfterData <=
TarHelpers
.RecordSize);
817
Span<byte> zeros = stackalloc byte[
TarHelpers
.RecordSize];
828
int paddingAfterData =
TarHelpers
.CalculatePadding(_size);
831
Debug.Assert(paddingAfterData <=
TarHelpers
.RecordSize);
850
int paddingAfterData =
TarHelpers
.CalculatePadding(_size);
System\Formats\Tar\TarReader.cs (2)
226
TarHelpers
.SkipBlockAlignmentPadding(_archiveStream, _previouslyReadEntry._header._size);
259
await
TarHelpers
.SkipBlockAlignmentPaddingAsync(_archiveStream, _previouslyReadEntry._header._size, cancellationToken).ConfigureAwait(false);
System\Formats\Tar\TarWriter.cs (5)
319
Span<byte> buffer = stackalloc byte[
TarHelpers
.RecordSize];
360
byte[] rented = ArrayPool<byte>.Shared.Rent(minimumLength:
TarHelpers
.RecordSize);
361
Memory<byte> buffer = rented.AsMemory(0,
TarHelpers
.RecordSize); // minimumLength means the array could've been larger
384
Span<byte> emptyRecord = stackalloc byte[
TarHelpers
.RecordSize];
396
const int TwoRecordSize =
TarHelpers
.RecordSize * 2;
System\Formats\Tar\TarWriter.Unix.cs (3)
57
Interop.Sys.FileTypes.S_IFREG =>
TarHelpers
.GetRegularFileEntryTypeForFormat(Format),
87
entry._header._mTime =
TarHelpers
.GetDateTimeOffsetFromSecondsSinceEpoch(status.MTime);
95
entry._header._mode = status.Mode & (int)
TarHelpers
.ValidUnixFileModes;