343 references to TarEntryType
Microsoft.DotNet.SignTool (2)
src\ZipData.cs (2)
625if (tar.EntryType == TarEntryType.Directory || 626(skipSymlinks && tar.EntryType == TarEntryType.SymbolicLink))
System.Formats.Tar (341)
System\Formats\Tar\GnuTarEntry.cs (10)
25/// <para>When creating an instance using the <see cref="GnuTarEntry(TarEntryType, string)"/> constructor, only the following entry types are supported:</para> 27/// <item>In all platforms: <see cref="TarEntryType.Directory"/>, <see cref="TarEntryType.HardLink"/>, <see cref="TarEntryType.SymbolicLink"/>, <see cref="TarEntryType.RegularFile"/>.</item> 28/// <item>In Unix platforms only: <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> and <see cref="TarEntryType.Fifo"/>.</item> 35public GnuTarEntry(TarEntryType entryType, string entryName) 105internal 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) 145/// <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. 163internal 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) 85if (_header._typeFlag is not TarEntryType.BlockDevice and not TarEntryType.CharacterDevice)
System\Formats\Tar\TarEntry.cs (62)
37internal TarEntry(TarEntryType entryType, string entryName, TarEntryFormat format, bool isGea) 41Debug.Assert(!isGea || entryType is TarEntryType.GlobalExtendedAttributes); 60TarEntryType compatibleEntryType = TarHelpers.GetCorrectTypeFlagForFormat(format, other.EntryType); 77public TarEntryType EntryType => _header._typeFlag; 115/// <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> 119/// 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. 121/// <exception cref="InvalidOperationException">The entry type is not <see cref="TarEntryType.HardLink"/> or <see cref="TarEntryType.SymbolicLink"/>.</exception> 129if (_header._typeFlag is not TarEntryType.HardLink and not TarEntryType.SymbolicLink) 185/// <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> 186/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para> 203if (EntryType is TarEntryType.SymbolicLink or TarEntryType.HardLink or TarEntryType.GlobalExtendedAttributes) 217/// <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> 218/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para></remarks> 237if (EntryType is TarEntryType.SymbolicLink or TarEntryType.HardLink or TarEntryType.GlobalExtendedAttributes) 250/// <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> 307if (EntryType == TarEntryType.Directory) 330if (EntryType == TarEntryType.Directory) 360if (EntryType is TarEntryType.SymbolicLink) 375else if (EntryType is TarEntryType.HardLink) 410if (EntryType is TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile) 429if (EntryType is TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile) 442Debug.Assert(EntryType is not (TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile)); 446case TarEntryType.Directory: 447case TarEntryType.DirectoryList: 463case TarEntryType.SymbolicLink: 469case TarEntryType.HardLink: 474case TarEntryType.BlockDevice: 478case TarEntryType.CharacterDevice: 482case TarEntryType.Fifo: 486case TarEntryType.ExtendedAttributes: 487case TarEntryType.GlobalExtendedAttributes: 488case TarEntryType.LongPath: 489case TarEntryType.LongLink: 493case TarEntryType.MultiVolume: 494case TarEntryType.RenamedOrSymlinked: 495case TarEntryType.SparseFile: 496case 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)
59internal TarEntryType _typeFlag; 90internal TarHeader(TarEntryFormat format, string name = "", int mode = 0, DateTimeOffset mTime = default, TarEntryType typeFlag = TarEntryType.RegularFile) 104internal TarHeader(TarEntryFormat format, TarEntryType typeFlag, TarHeader other)
System\Formats\Tar\TarHeader.Read.cs (52)
191case TarEntryType.ExtendedAttributes or TarEntryType.GlobalExtendedAttributes: 194case TarEntryType.LongLink or TarEntryType.LongPath: 197case TarEntryType.BlockDevice: 198case TarEntryType.CharacterDevice: 199case TarEntryType.Directory: 200case TarEntryType.Fifo: 201case TarEntryType.HardLink: 202case TarEntryType.SymbolicLink: 209case TarEntryType.RegularFile: 210case TarEntryType.V7RegularFile: // Treated as regular file 211case TarEntryType.ContiguousFile: // Treated as regular file 212case TarEntryType.DirectoryList: // Contains the list of filesystem entries in the data section 213case TarEntryType.MultiVolume: // Contains portion of a file 214case TarEntryType.RenamedOrSymlinked: // Might contain data 215case TarEntryType.SparseFile: // Contains portion of a file 216case TarEntryType.TapeVolume: // Might contain data 253case TarEntryType.ExtendedAttributes or TarEntryType.GlobalExtendedAttributes: 256case TarEntryType.LongLink or TarEntryType.LongPath: 259case TarEntryType.BlockDevice: 260case TarEntryType.CharacterDevice: 261case TarEntryType.Directory: 262case TarEntryType.Fifo: 263case TarEntryType.HardLink: 264case TarEntryType.SymbolicLink: 271case TarEntryType.RegularFile: 272case TarEntryType.V7RegularFile: // Treated as regular file 273case TarEntryType.ContiguousFile: // Treated as regular file 274case TarEntryType.DirectoryList: // Contains the list of filesystem entries in the data section 275case TarEntryType.MultiVolume: // Contains portion of a file 276case TarEntryType.RenamedOrSymlinked: // Might contain data 277case TarEntryType.SparseFile: // Contains portion of a file 278case TarEntryType.TapeVolume: // Might contain data 392typeFlag: (TarEntryType)buffer[FieldLocations.TypeFlag]) 405TarEntryType.ExtendedAttributes or 406TarEntryType.GlobalExtendedAttributes => TarEntryFormat.Pax, 408TarEntryType.DirectoryList or 409TarEntryType.LongLink or 410TarEntryType.LongPath or 411TarEntryType.MultiVolume or 412TarEntryType.RenamedOrSymlinked or 413TarEntryType.TapeVolume => TarEntryFormat.Gnu, 416TarEntryType.V7RegularFile => TarEntryFormat.V7, 418TarEntryType.SparseFile => throw new NotSupportedException(SR.Format(SR.TarEntryTypeNotSupported, header._typeFlag)), 422_ => (header._typeFlag == TarEntryType.RegularFile) ? TarEntryFormat.Ustar : TarEntryFormat.V7 527if (_typeFlag is TarEntryType.CharacterDevice or TarEntryType.BlockDevice) 695if (_typeFlag == TarEntryType.LongLink) 699else if (_typeFlag == TarEntryType.LongPath)
System\Formats\Tar\TarHeader.Write.cs (21)
174TarEntryType actualEntryType = TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.V7, _typeFlag); 184TarEntryType actualEntryType = TarHelpers.GetCorrectTypeFlagForFormat(TarEntryFormat.Ustar, _typeFlag); 216Debug.Assert(_typeFlag is TarEntryType.GlobalExtendedAttributes); 279Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 322Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 452return GetGnuLongMetadataHeader(dataStream, TarEntryType.LongLink); 458return GetGnuLongMetadataHeader(dataStream, TarEntryType.LongPath); 462private static TarHeader GetGnuLongMetadataHeader(MemoryStream dataStream, TarEntryType entryType) 464Debug.Assert(entryType is TarEntryType.LongPath or TarEntryType.LongLink); 522_typeFlag = isGea ? TarEntryType.GlobalExtendedAttributes : TarEntryType.ExtendedAttributes; 646private int WriteCommonFields(Span<byte> buffer, TarEntryType actualEntryType) 649Debug.Assert(!string.IsNullOrEmpty(_linkName) ^ (_typeFlag is not TarEntryType.SymbolicLink and not TarEntryType.HardLink)); 791if (_typeFlag is not TarEntryType.LongLink and not TarEntryType.LongPath) 965Debug.Assert(_typeFlag is TarEntryType.SymbolicLink or TarEntryType.HardLink); 1206return _typeFlag is TarEntryType.Directory or TarEntryType.DirectoryList ?
System\Formats\Tar\TarHelpers.cs (35)
48internal static int GetDefaultMode(TarEntryType type) 49=> type is TarEntryType.Directory or TarEntryType.DirectoryList ? (int)DefaultDirectoryMode : (int)DefaultFileMode; 200internal static TarEntryType GetCorrectTypeFlagForFormat(TarEntryFormat format, TarEntryType entryType) 204if (entryType is TarEntryType.RegularFile) 206return TarEntryType.V7RegularFile; 209else if (entryType is TarEntryType.V7RegularFile) 211return TarEntryType.RegularFile; 332internal static void ThrowIfEntryTypeNotSupported(TarEntryType entryType, TarEntryFormat archiveFormat, [CallerArgumentExpression(nameof(entryType))] string? paramName = null) 338TarEntryType.Directory or 339TarEntryType.HardLink or 340TarEntryType.V7RegularFile or 341TarEntryType.SymbolicLink) 349TarEntryType.BlockDevice or 350TarEntryType.CharacterDevice or 351TarEntryType.Directory or 352TarEntryType.Fifo or 353TarEntryType.HardLink or 354TarEntryType.RegularFile or 355TarEntryType.SymbolicLink) 363TarEntryType.BlockDevice or 364TarEntryType.CharacterDevice or 365TarEntryType.Directory or 366TarEntryType.Fifo or 367TarEntryType.HardLink or 368TarEntryType.RegularFile or 369TarEntryType.SymbolicLink) 381TarEntryType.BlockDevice or 382TarEntryType.CharacterDevice or 383TarEntryType.Directory or 384TarEntryType.Fifo or 385TarEntryType.HardLink or 386TarEntryType.RegularFile or 387TarEntryType.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)
207/// <item><see cref="TarEntryType.Directory"/></item> 208/// <item><see cref="TarEntryType.HardLink"/></item> 209/// <item><see cref="TarEntryType.SymbolicLink"/></item> 210/// <item><see cref="TarEntryType.V7RegularFile"/></item> 216/// <item><see cref="TarEntryType.BlockDevice"/></item> 217/// <item><see cref="TarEntryType.CharacterDevice"/></item> 218/// <item><see cref="TarEntryType.Directory"/></item> 219/// <item><see cref="TarEntryType.Fifo"/></item> 220/// <item><see cref="TarEntryType.HardLink"/></item> 221/// <item><see cref="TarEntryType.RegularFile"/></item> 222/// <item><see cref="TarEntryType.SymbolicLink"/></item> 227/// <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> 255/// <item><see cref="TarEntryType.Directory"/></item> 256/// <item><see cref="TarEntryType.HardLink"/></item> 257/// <item><see cref="TarEntryType.SymbolicLink"/></item> 258/// <item><see cref="TarEntryType.V7RegularFile"/></item> 264/// <item><see cref="TarEntryType.BlockDevice"/></item> 265/// <item><see cref="TarEntryType.CharacterDevice"/></item> 266/// <item><see cref="TarEntryType.Directory"/></item> 267/// <item><see cref="TarEntryType.Fifo"/></item> 268/// <item><see cref="TarEntryType.HardLink"/></item> 269/// <item><see cref="TarEntryType.RegularFile"/></item> 270/// <item><see cref="TarEntryType.SymbolicLink"/></item> 275/// <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> 310if (entry._header._typeFlag is TarEntryType.GlobalExtendedAttributes) 345TarEntryFormat.Pax when entry._header._typeFlag is TarEntryType.GlobalExtendedAttributes => entry._header.WriteAsPaxGlobalExtendedAttributesAsync(_archiveStream, buffer, _nextGlobalExtendedAttributesEntryNumber++, cancellationToken), 402private static void ValidateEntryLinkName(TarEntryType entryType, string? linkName) 404if (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) 95if (entry.EntryType == TarEntryType.SymbolicLink) 100if (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;