Class CpioEntry

Class CpioEntry

اسم الفضاء : Aspose.Zip.Cpio تجميع: Aspose.Zip.dll (25.5.0)

يمثل ملفًا واحدًا داخل أرشيف cpio.

public sealed class CpioEntry : IArchiveFileEntry

Inheritance

object CpioEntry

Implements

IArchiveFileEntry

الأعضاء الموروثين

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

Properties

IsDirectory

يحصل على قيمة تشير إلى ما إذا كان الإدخال يمثل دليل.

public bool IsDirectory { get; }

قيمة الممتلكات

bool

LastWriteTimeUtc

حصلت على آخر وقت للكتابة

public DateTime LastWriteTimeUtc { get; }

قيمة الممتلكات

DateTime

Length

يحصل على مدة الدخول في بايت.

public long Length { get; }

قيمة الممتلكات

long

Name

يحصل على اسم الإدخال داخل الأرشيف.

public string Name { get; }

قيمة الممتلكات

string

Parent

يحصل على الأرشيف الذي تنتمي إليه.

public CpioArchive Parent { get; }

قيمة الممتلكات

CpioArchive

Methods

Extract(الستار)

استخراج الدخول إلى نظام الملفات عن طريق المسار المقدم.

public FileSystemInfo Extract(string path)

Parameters

path string

المسار إلى الملف المستهدف.إذا كان الملف موجودًا بالفعل ، فسيتم إعادة كتابته.

Returns

FileSystemInfo

ملف المعلومات من ملف مكون.

Examples

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

Exceptions

ArgumentNullException

path’ is null.

SecurityException

لا يحصل المتصل على إذن الوصول المطلوب.

ArgumentException

الطريق " فارغ ، يحتوي على مساحات بيضاء فقط ، أو يحتوي على أحرف غير صحيحة.

UnauthorizedAccessException

يتم رفض الوصول إلى ملف path".

PathTooLongException

على سبيل المثال ، على المنصات المستندة إلى Windows ، يجب أن تكون المسارات أقل من 248 حرفًا ، ويجب أن يكون اسم الملف أقل من 260 حرفًا.

NotSupportedException

ملف في path’ يحتوي على عمود (:) في وسط السلسلة.

FileNotFoundException

لم يتم العثور على الملف.

DirectoryNotFoundException

المسار المحدد غير صالح ، على سبيل المثال ، على محرك أقراص غير مسجلة.

IOException

الملف مفتوح بالفعل.

Extract(Stream)

إخراج الدخول إلى التدفق المقدم.

public void Extract(Stream destination)

Parameters

destination Stream

كلمات مفتاحية يجب أن تكون مكتوبة

Examples

استخراج إدخال من أرشيف cpio.

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

Exceptions

ArgumentException

destination’ does not support writing.

Open()

يفتح الإدخال للاستخراج ويقدم تدفقًا مع محتوى الإدخال.

public Stream Open()

Returns

Stream

التدفق الذي يمثل المحتوى من الدخول.

Examples

الاستخدام :Stream decompressed = entry.Open();

.NET 4.0 أو أعلى - استخدم طريقة Stream.CopyTo:decompressed.CopyTo(httpResponse.OutputStream)

.NET 3.5 وما قبلها - نسخ بايتات يدويا:

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

 عربي