Class CpioEntry

Class CpioEntry

İsim alanı : Aspose.Zip.Cpio Toplama: Aspose.Zip.dll (25.5.0)

Cpio arşivinde tek bir dosyayı temsil eder.

public sealed class CpioEntry : IArchiveFileEntry

Inheritance

object CpioEntry

Implements

IArchiveFileEntry

mirasçı üyeleri

object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Properties

IsDirectory

Giriş bir dizin olup olmadığını gösteren bir değer alır.

public bool IsDirectory { get; }

Mülkiyet Değer

bool

LastWriteTimeUtc

Yazma son zamanını alır.

public DateTime LastWriteTimeUtc { get; }

Mülkiyet Değer

DateTime

Length

Giriş süresi byte olarak belirlenir.

public long Length { get; }

Mülkiyet Değer

long

Name

Arşiv içindeki giriş isimini alır.

public string Name { get; }

Mülkiyet Değer

string

Parent

Arşiv içeriğine girer.

public CpioArchive Parent { get; }

Mülkiyet Değer

CpioArchive

Methods

Extract(Sırt)

Dosya sistemine verilen yoldan giriş çıkarır.

public FileSystemInfo Extract(string path)

Parameters

path string

Hedef dosyasına giden yol. eğer dosya zaten mevcutsa, aşırı yazılacaktır.

Returns

FileSystemInfo

Bir kompozit dosyanın dosya bilgisi.

Examples

using (var archive = new CpioArchive("archive.cpio"))
{
    archive.Entries[0].Extract("data.bin");
}

Exceptions

ArgumentNullException

path’ is null.

SecurityException

Müşteri, gerekli izinleri almamaktadır.

ArgumentException

path’ boş, yalnızca beyaz alanlar içerir veya geçersiz karakterler içerir.

UnauthorizedAccessException

path" dosyasına erişim reddedilir.

PathTooLongException

Belirlenen path’, dosya adı, ya da her ikisi de sistem tarafından tanımlanan maksimum uzunluğu aşmaktadır. Örneğin, Windows tabanlı platformlarda, yollar 248 karakterden az olmalıdır ve dosya isimleri 260 karakterden az olmalıdır.

NotSupportedException

path’daki dosya, satırın ortasında bir sütun (:) içerir.

FileNotFoundException

Dosya bulunamadı.

DirectoryNotFoundException

Belirlenmiş yol geçersizdir, örneğin haritalmamış bir sürücü üzerinde olması.

IOException

Dosya zaten açıktır.

Extract(Stream)

Gönderilen akışın içeriğini çıkarır.

public void Extract(Stream destination)

Parameters

destination Stream

Destination stream. yazılabilir olması gerekir.

Examples

Cpio arşivinden bir giriş çıkarın.

using (var archive = new CpioArchive("archive.cpio"))
{
    archive.Entries[0].Extract(httpResponseStream);
}

Exceptions

ArgumentException

destination’ does not support writing.

Open()

Ekstraksiyon için giriş açılır ve giriş içeriği ile bir akış sağlar.

public Stream Open()

Returns

Stream

Giriş içeriğini temsil eden akım.

Examples

Kullanımı :Stream decompressed = entry.Open();

.NET 4.0 ve üstü - Stream.CopyTo yöntemi kullanın:decompressed.CopyTo(httpResponse.OutputStream)

.NET 3.5 ve öncesi - byteyi manuel olarak kopyalayın:

byte[] buffer = new byte[8192];
int bytesRead;
while (0 < (bytesRead = decompressed.Read(buffer, 0, buffer.Length)))
 fileStream.Write(buffer, 0, bytesRead);
```</p>

#### Remarks

Read from the stream to get the original content of a file. See examples section.

### <a id="Aspose_Zip_Cpio_CpioEntry_ToString"></a> ToString\(\)

```csharp
public override string ToString()

Returns

string

 Türkçe