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

path’ は空っぽで、白いスペースのみが含まれ、または無効な文字が含まれています。

UnauthorizedAccessException

path" ファイルへのアクセスは拒否されます。

PathTooLongException

指定された path’, ファイル名, または両方ともシステム定義の最大長さを超えています. たとえば、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

 日本語