343 references to TarEntryType
System.Formats.Tar (343)
System\Formats\Tar\GnuTarEntry.cs (10)
23/// <remarks>When creating an instance using the <see cref="GnuTarEntry(TarEntryType, string)"/> constructor, only the following entry types are supported: 25/// <item>In all platforms: <see cref="TarEntryType.Directory"/>, <see cref="TarEntryType.HardLink"/>, <see cref="TarEntryType.SymbolicLink"/>, <see cref="TarEntryType.RegularFile"/>.</item> 26/// <item>In Unix platforms only: <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> and <see cref="TarEntryType.Fifo"/>.</item> 33public GnuTarEntry(TarEntryType entryType, string entryName) 121internal override bool IsDataStreamSetterSupported() => EntryType is TarEntryType.RegularFile;
System\Formats\Tar\PaxGlobalExtendedAttributesTarEntry.cs (1)
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
System\Formats\Tar\PaxTarEntry.cs (22)
28/// <remarks><para>When creating an instance using the <see cref="PaxTarEntry(TarEntryType, string)"/> constructor, only the following entry types are supported:</para> 30/// <item>In all platforms: <see cref="TarEntryType.Directory"/>, <see cref="TarEntryType.HardLink"/>, <see cref="TarEntryType.SymbolicLink"/>, <see cref="TarEntryType.RegularFile"/>.</item> 31/// <item>In Unix platforms only: <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> and <see cref="TarEntryType.Fifo"/>.</item> 33/// <para>Use the <see cref="PaxTarEntry(TarEntryType, string, IEnumerable{KeyValuePair{string, string}})"/> constructor to include additional extended attributes when creating the entry.</para> 52public PaxTarEntry(TarEntryType entryType, string entryName) 67/// <remarks>When creating an instance using the <see cref="PaxTarEntry(TarEntryType, string)"/> constructor, only the following entry types are supported: 69/// <item>In all platforms: <see cref="TarEntryType.Directory"/>, <see cref="TarEntryType.HardLink"/>, <see cref="TarEntryType.SymbolicLink"/>, <see cref="TarEntryType.RegularFile"/>.</item> 70/// <item>In Unix platforms only: <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> and <see cref="TarEntryType.Fifo"/>.</item> 91public PaxTarEntry(TarEntryType entryType, string entryName, IEnumerable<KeyValuePair<string, string>> extendedAttributes) 136/// <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. 154internal override bool IsDataStreamSetterSupported() => EntryType == TarEntryType.RegularFile;
System\Formats\Tar\PosixTarEntry.cs (5)
22internal PosixTarEntry(TarEntryType entryType, string entryName, TarEntryFormat format, bool isGea) 59if (_header._typeFlag is not TarEntryType.BlockDevice and not TarEntryType.CharacterDevice) 82if (_header._typeFlag is not TarEntryType.BlockDevice and not TarEntryType.CharacterDevice)
System\Formats\Tar\TarEntry.cs (62)
34internal TarEntry(TarEntryType entryType, string entryName, TarEntryFormat format, bool isGea) 38Debug.Assert(!isGea || entryType is TarEntryType.GlobalExtendedAttributes); 57TarEntryType compatibleEntryType = TarHelpers.GetCorrectTypeFlagForFormat(format, other.EntryType); 74public TarEntryType EntryType => _header._typeFlag; 109/// <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> 113/// When the <see cref="EntryType"/> indicates a <see cref="TarEntryType.SymbolicLink"/> or a <see cref="TarEntryType.HardLink"/>, this property returns the link target path of such link. 115/// <exception cref="InvalidOperationException">The entry type is not <see cref="TarEntryType.HardLink"/> or <see cref="TarEntryType.SymbolicLink"/>.</exception> 123if (_header._typeFlag is not TarEntryType.HardLink and not TarEntryType.SymbolicLink) 179/// <remarks><para>Files of type <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> or <see cref="TarEntryType.Fifo"/> can only be extracted in Unix platforms.</para> 180/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para> 197if (EntryType is TarEntryType.SymbolicLink or TarEntryType.HardLink or TarEntryType.GlobalExtendedAttributes) 211/// <remarks><para>Files of type <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> or <see cref="TarEntryType.Fifo"/> can only be extracted in Unix platforms.</para> 212/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para></remarks> 231if (EntryType is TarEntryType.SymbolicLink or TarEntryType.HardLink or TarEntryType.GlobalExtendedAttributes) 244/// <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> 292if (EntryType == TarEntryType.Directory) 315if (EntryType == TarEntryType.Directory) 345if (EntryType is TarEntryType.SymbolicLink) 360else if (EntryType is TarEntryType.HardLink) 395if (EntryType is TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile) 414if (EntryType is TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile) 427Debug.Assert(EntryType is not TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile); 431case TarEntryType.Directory: 432case TarEntryType.DirectoryList: 448case TarEntryType.SymbolicLink: 454case TarEntryType.HardLink: 459case TarEntryType.BlockDevice: 463case TarEntryType.CharacterDevice: 467case TarEntryType.Fifo: 471case TarEntryType.ExtendedAttributes: 472case TarEntryType.GlobalExtendedAttributes: 473case TarEntryType.LongPath: 474case TarEntryType.LongLink: 478case TarEntryType.MultiVolume: 479case TarEntryType.RenamedOrSymlinked: 480case TarEntryType.SparseFile: 481case TarEntryType.TapeVolume:
System\Formats\Tar\TarEntry.Unix.cs (4)
16Debug.Assert(EntryType is TarEntryType.BlockDevice); 23Debug.Assert(EntryType is TarEntryType.CharacterDevice); 30Debug.Assert(EntryType is TarEntryType.Fifo); 37Debug.Assert(EntryType is TarEntryType.HardLink);
System\Formats\Tar\TarFile.cs (22)
160/// <remarks><para>Files of type <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> or <see cref="TarEntryType.Fifo"/> can only be extracted in Unix platforms.</para> 161/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para></remarks> 201/// <remarks><para>Files of type <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> or <see cref="TarEntryType.Fifo"/> can only be extracted in Unix platforms.</para> 202/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para></remarks> 244/// <remarks><para>Files of type <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> or <see cref="TarEntryType.Fifo"/> can only be extracted in Unix platforms.</para> 245/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para></remarks> 287/// <remarks><para>Files of type <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> or <see cref="TarEntryType.Fifo"/> can only be extracted in Unix platforms.</para> 288/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para></remarks> 465if (entry.EntryType is not TarEntryType.GlobalExtendedAttributes) 510if (entry.EntryType is not TarEntryType.GlobalExtendedAttributes)
System\Formats\Tar\TarHeader.cs (4)
58internal TarEntryType _typeFlag; 89internal TarHeader(TarEntryFormat format, string name = "", int mode = 0, DateTimeOffset mTime = default, TarEntryType typeFlag = TarEntryType.RegularFile) 102internal TarHeader(TarEntryFormat format, TarEntryType typeFlag, TarHeader other)
System\Formats\Tar\TarHeader.Read.cs (52)
187case TarEntryType.ExtendedAttributes or TarEntryType.GlobalExtendedAttributes: 190case TarEntryType.LongLink or TarEntryType.LongPath: 193case TarEntryType.BlockDevice: 194case TarEntryType.CharacterDevice: 195case TarEntryType.Directory: 196case TarEntryType.Fifo: 197case TarEntryType.HardLink: 198case TarEntryType.SymbolicLink: 205case TarEntryType.RegularFile: 206case TarEntryType.V7RegularFile: // Treated as regular file 207case TarEntryType.ContiguousFile: // Treated as regular file 208case TarEntryType.DirectoryList: // Contains the list of filesystem entries in the data section 209case TarEntryType.MultiVolume: // Contains portion of a file 210case TarEntryType.RenamedOrSymlinked: // Might contain data 211case TarEntryType.SparseFile: // Contains portion of a file 212case TarEntryType.TapeVolume: // Might contain data 249case TarEntryType.ExtendedAttributes or TarEntryType.GlobalExtendedAttributes: 252case TarEntryType.LongLink or TarEntryType.LongPath: 255case TarEntryType.BlockDevice: 256case TarEntryType.CharacterDevice: 257case TarEntryType.Directory: 258case TarEntryType.Fifo: 259case TarEntryType.HardLink: 260case TarEntryType.SymbolicLink: 267case TarEntryType.RegularFile: 268case TarEntryType.V7RegularFile: // Treated as regular file 269case TarEntryType.ContiguousFile: // Treated as regular file 270case TarEntryType.DirectoryList: // Contains the list of filesystem entries in the data section 271case TarEntryType.MultiVolume: // Contains portion of a file 272case TarEntryType.RenamedOrSymlinked: // Might contain data 273case TarEntryType.SparseFile: // Contains portion of a file 274case TarEntryType.TapeVolume: // Might contain data 389typeFlag: (TarEntryType)buffer[FieldLocations.TypeFlag]) 402TarEntryType.ExtendedAttributes or 403TarEntryType.GlobalExtendedAttributes => TarEntryFormat.Pax, 405TarEntryType.DirectoryList or 406TarEntryType.LongLink or 407TarEntryType.LongPath or 408TarEntryType.MultiVolume or 409TarEntryType.RenamedOrSymlinked or 410TarEntryType.TapeVolume => TarEntryFormat.Gnu, 413TarEntryType.V7RegularFile => TarEntryFormat.V7, 415TarEntryType.SparseFile => throw new NotSupportedException(SR.Format(SR.TarEntryTypeNotSupported, header._typeFlag)), 419_ => (header._typeFlag == TarEntryType.RegularFile) ? TarEntryFormat.Ustar : TarEntryFormat.V7 524if (_typeFlag is TarEntryType.CharacterDevice or TarEntryType.BlockDevice) 683if (_typeFlag == TarEntryType.LongLink) 687else if (_typeFlag == TarEntryType.LongPath)
System\Formats\Tar\TarHeader.Write.cs (23)
161TarEntryType actualEntryType = TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.V7, _typeFlag); 171TarEntryType actualEntryType = TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.Ustar, _typeFlag); 203Debug.Assert(_typeFlag is TarEntryType.GlobalExtendedAttributes); 266Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 309Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 357TarHeader longLinkHeader = GetGnuLongMetadataHeader(TarEntryType.LongLink, _linkName); 366TarHeader longPathHeader = GetGnuLongMetadataHeader(TarEntryType.LongPath, _name); 393TarHeader longLinkHeader = GetGnuLongMetadataHeader(TarEntryType.LongLink, _linkName); 402TarHeader longPathHeader = GetGnuLongMetadataHeader(TarEntryType.LongPath, _name); 420private static TarHeader GetGnuLongMetadataHeader(TarEntryType entryType, string longText) 422Debug.Assert(entryType is TarEntryType.LongPath or TarEntryType.LongLink); 476_typeFlag = isGea ? TarEntryType.GlobalExtendedAttributes : TarEntryType.ExtendedAttributes; 600private int WriteCommonFields(Span<byte> buffer, TarEntryType actualEntryType) 603Debug.Assert(!string.IsNullOrEmpty(_linkName) ^ (_typeFlag is not TarEntryType.SymbolicLink and not TarEntryType.HardLink)); 635Debug.Assert(_typeFlag is not TarEntryType.ExtendedAttributes and not TarEntryType.GlobalExtendedAttributes); 915Debug.Assert(_typeFlag is TarEntryType.SymbolicLink or TarEntryType.HardLink); 1070return _typeFlag is TarEntryType.Directory or TarEntryType.DirectoryList ?
System\Formats\Tar\TarHelpers.cs (35)
49internal static int GetDefaultMode(TarEntryType type) 50=> type is TarEntryType.Directory or TarEntryType.DirectoryList ? (int)DefaultDirectoryMode : (int)DefaultFileMode; 201internal static TarEntryType GetCorrectTypeFlagForFormat(TarEntryFormat format, TarEntryType entryType) 205if (entryType is TarEntryType.RegularFile) 207return TarEntryType.V7RegularFile; 210else if (entryType is TarEntryType.V7RegularFile) 212return TarEntryType.RegularFile; 310internal static void ThrowIfEntryTypeNotSupported(TarEntryType entryType, TarEntryFormat archiveFormat, [CallerArgumentExpression(nameof(entryType))] string? paramName = null) 316TarEntryType.Directory or 317TarEntryType.HardLink or 318TarEntryType.V7RegularFile or 319TarEntryType.SymbolicLink) 327TarEntryType.BlockDevice or 328TarEntryType.CharacterDevice or 329TarEntryType.Directory or 330TarEntryType.Fifo or 331TarEntryType.HardLink or 332TarEntryType.RegularFile or 333TarEntryType.SymbolicLink) 341TarEntryType.BlockDevice or 342TarEntryType.CharacterDevice or 343TarEntryType.Directory or 344TarEntryType.Fifo or 345TarEntryType.HardLink or 346TarEntryType.RegularFile or 347TarEntryType.SymbolicLink) 359TarEntryType.BlockDevice or 360TarEntryType.CharacterDevice or 361TarEntryType.Directory or 362TarEntryType.Fifo or 363TarEntryType.HardLink or 364TarEntryType.RegularFile or 365TarEntryType.SymbolicLink)
System\Formats\Tar\TarReader.cs (41)
138TarEntryFormat.Pax => header._typeFlag is TarEntryType.GlobalExtendedAttributes ? 291TarEntryFormat.Pax => header._typeFlag is TarEntryType.GlobalExtendedAttributes ? 331if (header._typeFlag is TarEntryType.ExtendedAttributes) 340else if (header._typeFlag is TarEntryType.LongLink or TarEntryType.LongPath) 372if (header._typeFlag is TarEntryType.ExtendedAttributes) 382else if (header._typeFlag is TarEntryType.LongLink or TarEntryType.LongPath) 409if (actualHeader._typeFlag is TarEntryType.GlobalExtendedAttributes or 410TarEntryType.ExtendedAttributes or 411TarEntryType.LongLink or 412TarEntryType.LongPath) 414throw new InvalidDataException(SR.Format(SR.TarUnexpectedMetadataEntry, actualHeader._typeFlag, TarEntryType.ExtendedAttributes)); 441if (actualHeader._typeFlag is TarEntryType.GlobalExtendedAttributes or 442TarEntryType.ExtendedAttributes or 443TarEntryType.LongLink or 444TarEntryType.LongPath) 446throw new InvalidDataException(SR.Format(SR.TarUnexpectedMetadataEntry, actualHeader._typeFlag, TarEntryType.ExtendedAttributes)); 450if (actualHeader._typeFlag is TarEntryType.ExtendedAttributes) 452throw new InvalidDataException(SR.Format(SR.TarUnexpectedMetadataEntry, TarEntryType.ExtendedAttributes, TarEntryType.ExtendedAttributes)); 485if ((header._typeFlag is TarEntryType.LongLink && secondHeader._typeFlag is TarEntryType.LongPath) || 486(header._typeFlag is TarEntryType.LongPath && secondHeader._typeFlag is TarEntryType.LongLink)) 497if (thirdHeader._typeFlag is TarEntryType.LongLink or TarEntryType.LongPath) 502if (header._typeFlag is TarEntryType.LongLink) 510else if (header._typeFlag is TarEntryType.LongPath) 523if (header._typeFlag is TarEntryType.LongLink) 528else if (header._typeFlag is TarEntryType.LongPath) 562if ((header._typeFlag is TarEntryType.LongLink && secondHeader._typeFlag is TarEntryType.LongPath) || 563(header._typeFlag is TarEntryType.LongPath && secondHeader._typeFlag is TarEntryType.LongLink)) 573if (thirdHeader._typeFlag is TarEntryType.LongLink or TarEntryType.LongPath) 578if (header._typeFlag is TarEntryType.LongLink) 586else if (header._typeFlag is TarEntryType.LongPath) 599if (header._typeFlag is TarEntryType.LongLink) 604else if (header._typeFlag is TarEntryType.LongPath)
System\Formats\Tar\TarWriter.cs (31)
196/// <item><see cref="TarEntryType.Directory"/></item> 197/// <item><see cref="TarEntryType.HardLink"/></item> 198/// <item><see cref="TarEntryType.SymbolicLink"/></item> 199/// <item><see cref="TarEntryType.V7RegularFile"/></item> 205/// <item><see cref="TarEntryType.BlockDevice"/></item> 206/// <item><see cref="TarEntryType.CharacterDevice"/></item> 207/// <item><see cref="TarEntryType.Directory"/></item> 208/// <item><see cref="TarEntryType.Fifo"/></item> 209/// <item><see cref="TarEntryType.HardLink"/></item> 210/// <item><see cref="TarEntryType.RegularFile"/></item> 211/// <item><see cref="TarEntryType.SymbolicLink"/></item> 216/// <exception cref="ArgumentException">The entry type is <see cref="TarEntryType.HardLink"/> or <see cref="TarEntryType.SymbolicLink"/> and the <see cref="TarEntry.LinkName"/> is <see langword="null"/> or empty.</exception> 240/// <item><see cref="TarEntryType.Directory"/></item> 241/// <item><see cref="TarEntryType.HardLink"/></item> 242/// <item><see cref="TarEntryType.SymbolicLink"/></item> 243/// <item><see cref="TarEntryType.V7RegularFile"/></item> 249/// <item><see cref="TarEntryType.BlockDevice"/></item> 250/// <item><see cref="TarEntryType.CharacterDevice"/></item> 251/// <item><see cref="TarEntryType.Directory"/></item> 252/// <item><see cref="TarEntryType.Fifo"/></item> 253/// <item><see cref="TarEntryType.HardLink"/></item> 254/// <item><see cref="TarEntryType.RegularFile"/></item> 255/// <item><see cref="TarEntryType.SymbolicLink"/></item> 260/// <exception cref="ArgumentException">The entry type is <see cref="TarEntryType.HardLink"/> or <see cref="TarEntryType.SymbolicLink"/> and the <see cref="TarEntry.LinkName"/> is <see langword="null"/> or empty.</exception> 295if (entry._header._typeFlag is TarEntryType.GlobalExtendedAttributes) 330TarEntryFormat.Pax when entry._header._typeFlag is TarEntryType.GlobalExtendedAttributes => entry._header.WriteAsPaxGlobalExtendedAttributesAsync(_archiveStream, buffer, _nextGlobalExtendedAttributesEntryNumber++, cancellationToken), 387private static void ValidateEntryLinkName(TarEntryType entryType, string? linkName) 389if (entryType is TarEntryType.HardLink or TarEntryType.SymbolicLink)
System\Formats\Tar\TarWriter.Unix.cs (14)
28TarEntryType entryType = (status.Mode & (uint)Interop.Sys.FileTypes.S_IFMT) switch 32Interop.Sys.FileTypes.S_IFBLK => TarEntryType.BlockDevice, 33Interop.Sys.FileTypes.S_IFCHR => TarEntryType.CharacterDevice, 34Interop.Sys.FileTypes.S_IFIFO => TarEntryType.Fifo, 35Interop.Sys.FileTypes.S_IFLNK => TarEntryType.SymbolicLink, 36Interop.Sys.FileTypes.S_IFREG => Format is TarEntryFormat.V7 ? TarEntryType.V7RegularFile : TarEntryType.RegularFile, 37Interop.Sys.FileTypes.S_IFDIR => TarEntryType.Directory, 41FileSystemInfo info = entryType is TarEntryType.Directory ? new DirectoryInfo(fullPath) : new FileInfo(fullPath); 52if (entryType is TarEntryType.BlockDevice or TarEntryType.CharacterDevice) 92if (entry.EntryType == TarEntryType.SymbolicLink) 97if (entry.EntryType is TarEntryType.RegularFile or TarEntryType.V7RegularFile)
System\Formats\Tar\UstarTarEntry.cs (10)
22/// <remarks>When creating an instance using the <see cref="UstarTarEntry(TarEntryType, string)"/> constructor, only the following entry types are supported: 24/// <item>In all platforms: <see cref="TarEntryType.Directory"/>, <see cref="TarEntryType.HardLink"/>, <see cref="TarEntryType.SymbolicLink"/>, <see cref="TarEntryType.RegularFile"/>.</item> 25/// <item>In Unix platforms only: <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> and <see cref="TarEntryType.Fifo"/>.</item> 32public UstarTarEntry(TarEntryType entryType, string entryName) 58internal override bool IsDataStreamSetterSupported() => EntryType == TarEntryType.RegularFile;
System\Formats\Tar\V7TarEntry.cs (7)
22/// <remarks>When creating an instance using the <see cref="V7TarEntry(TarEntryType, string)"/> constructor, only the following entry types are supported: <see cref="TarEntryType.Directory"/>, <see cref="TarEntryType.HardLink"/>, <see cref="TarEntryType.SymbolicLink"/> and <see cref="TarEntryType.V7RegularFile"/>.</remarks> 27public V7TarEntry(TarEntryType entryType, string entryName) 44internal override bool IsDataStreamSetterSupported() => EntryType == TarEntryType.V7RegularFile;