Class CpioArchive
이름 공간 : Aspose.Zip.Cpio 모임: Aspose.Zip.dll (25.5.0)
이 클래스는 cpio 파일을 나타냅니다.
public class CpioArchive : IArchive, IDisposable
Inheritance
Implements
상속 회원들
object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Constructors
CpioArchive()
Aspose.Zip.Cpio.CpioArchive 클래스의 새로운 사례를 시작합니다.
public CpioArchive()
Examples
다음 예제는 파일을 압축하는 방법을 보여줍니다.
using (var archive = new CpioArchive())
{
archive.CreateEntry("first.bin", "data.bin");
archive.Save("archive.cpio");
}
CpioArchive(Stream)
Aspose.Zip.Cpio.CpioArchive 클래스의 새로운 예를 시작하고 아카이브에서 추출 할 수있는 입력 목록을 구성합니다.
public CpioArchive(Stream sourceStream)
Parameters
sourceStream
Stream
아카이브의 출처는 검색 가능해야 합니다.
Examples
다음 예제는 모든 게시물을 디렉토리로 추출하는 방법을 보여줍니다.
using (var archive = new CpioArchive(File.OpenRead("archive.cpio")))
{
archive.ExtractToDirectory("C:\extracted");
}
Remarks
이 컨테이너는 어떤 입력도 제거하지 않습니다. Aspose.Zip.Cpio.CpioEntry.Open 방법을 참조하십시오.
Exceptions
sourceStream’ is null.
sourceStream’ is not seekable.
sourceStream’ is not valid cpio archive.
CpioArchive(스트리트)
Aspose.Zip.Cpio.CpioArchive 클래스의 새로운 예를 시작하고 아카이브에서 추출 할 수있는 입력 목록을 구성합니다.
public CpioArchive(string path)
Parameters
path
string
아카이브 파일로 가는 길입니다.
Examples
다음 예제는 모든 게시물을 디렉토리로 추출하는 방법을 보여줍니다.
using (var archive = new CpioArchive("archive.cpio"))
{
archive.ExtractToDirectory("C:\extracted");
}
Remarks
이 컨테이너는 어떤 입력도 제거하지 않습니다. Aspose.Zip.Cpio.CpioEntry.Open 방법을 참조하십시오.
Exceptions
path’ is null.
호출자는 필요한 액세스 허가를 가지고 있지 않습니다.
path’는 텅 비어 있고, 흰색 공간만 포함하거나, 불가능한 문자를 포함합니다.
path" 파일에 대한 액세스는 거부됩니다.
지정된 path’, 파일 이름, 또는 둘 다 시스템에 의해 정의 된 최대 길이를 초과합니다.예를 들어, Windows 기반 플랫폼에서 경로는 248 문자 미만이어야하며 파일 이름은 260 문자 미만이어야합니다.
path’에 있는 파일에는 링의 중간에 있는 열(:)이 포함되어 있습니다.
파일은 찾을 수 없습니다.
지정된 경로는 불가능하며, 예를 들어 지정되지 않은 드라이브에 있습니다.
파일은 이미 열려 있습니다.
Properties
Entries
그것은 아카이브를 구성하는 Aspose.Zip.Cpio.CpioEntry 형식의 입력을 얻습니다.
public ReadOnlyCollection<cpioentry> Entries { get; }
부동산 가치
ReadOnlyCollection <에 대한 정보 CpioEntry >
Methods
CreateEntries(링크, 볼)
아카이브에 모든 파일과 디렉토리를 주어진 디렉토리에 반복적으로 추가합니다.
public CpioArchive CreateEntries(string sourceDirectory, bool includeRootDirectory = true)
Parameters
sourceDirectory
string
컴프레스를 위한 디렉토리
includeRootDirectory
bool
뿌리 디렉토리 자체를 포함하거나 포함하지 않는지 나타냅니다.
Returns
Cpio 입장 사례.
Examples
using (FileStream cpioFile = File.Open("archive.cpio", FileMode.Create))
{
using (var archive = new CpioArchive())
{
archive.CreateEntries("C:\folder", false);
archive.Save(cpioFile);
}
}
Exceptions
sourceDirectory’ is null.
호출자는 sourceDirectory"에 액세스 할 수있는 필요한 허가가 없습니다.
sourceDirectory’ contains invalid characters such as “, <, >, or |.
지정된 경로, 파일 이름 또는 둘 다 시스템에 의해 정의 된 최대 길이를 초과합니다. 예를 들어, Windows 기반 플랫폼에서 경로는 248 문자 미만이어야하며 파일 이름은 260 문자 미만이어야합니다. 지정된 경로, 파일 이름 또는 둘 다 너무 길다.
sourceDirectory’ stands for a file, not for a directory.
CreateEntries(디렉토리Info, Bool)
아카이브에 모든 파일과 디렉토리를 주어진 디렉토리에 반복적으로 추가합니다.
public CpioArchive CreateEntries(DirectoryInfo directory, bool includeRootDirectory = true)
Parameters
directory
DirectoryInfo
컴프레스를 위한 디렉토리
includeRootDirectory
bool
뿌리 디렉토리 자체를 포함하거나 포함하지 않는지 나타냅니다.
Returns
Cpio 입장 사례.
Examples
using (FileStream cpioFile = File.Open("archive.cpio", FileMode.Create))
{
using (var archive = new CpioArchive())
{
archive.CreateEntries(new DirectoryInfo("C:\folder"), false);
archive.Save(cpioFile);
}
}
Exceptions
directory’ is null.
호출자는 directory"에 액세스 할 수있는 필요한 허가를 가지고 있지 않습니다.
directory’ stands for a file, not for a directory.
CreateEntry(링크, FileInfo, Bool)
아카이브 내에서 단일 입력을 만듭니다.
public CpioEntry CreateEntry(string name, FileInfo fileInfo, bool openImmediately = false)
Parameters
name
string
입구의 이름입니다.
fileInfo
FileInfo
파일 또는 폴더의 메타 데이터가 압축됩니다.
openImmediately
bool
사실, 즉시 파일을 열면, 그렇지 않으면 파일을 저장할 수 있습니다.
Returns
Cpio 입장 사례.
Examples
FileInfo fileInfo = new FileInfo("data.bin");
using (var archive = new CpioArchive())
{
archive.CreateEntry("test.bin", fileInfo);
archive.Save("archive.cpio");
}
Remarks
파일이 파라미터로 즉시 열리면 파일이 삭제 될 때까지 차단됩니다.
Exceptions
name’ is null.
name’ is empty.
fileInfo’ is null.
CreateEntry(스트리트, 스트리트, 볼)
아카이브 내에서 단일 입력을 만듭니다.
public CpioEntry CreateEntry(string name, string sourcePath, bool openImmediately = false)
Parameters
name
string
입구의 이름입니다.
sourcePath
string
파일을 압축하는 방법입니다.
openImmediately
bool
사실, 즉시 파일을 열면, 그렇지 않으면 파일을 저장할 수 있습니다.
Returns
Cpio 입장 사례.
Examples
using (var archive = new CpioArchive())
{
archive.CreateEntry("first.bin", "data.bin");
archive.Save("archive.cpio");
}
Remarks
입력 이름은 단지 파라미터 내에 설정됩니다.파라미터에 제공된 파일 이름은 입력 이름에 영향을 미치지 않습니다.
파일이 파라미터로 즉시 열리면 파일이 삭제 될 때까지 차단됩니다.
Exceptions
sourcePath’ is null.
호출자는 필요한 액세스 허가를 가지고 있지 않습니다.
sourcePath’는 텅 비어 있고, 단지 흰색 공간만 포함하거나, 불법 문자를 포함합니다. - 또는 - 파일 이름,
name’의 일부로서, 100 개 이상의 상징을 초과합니다.
sourcePath’ 파일에 대한 액세스는 거부됩니다.
지정된 sourcePath’, 파일 이름, 또는 둘 다 시스템에 의해 정의 된 최대 길이를 초과합니다. 예를 들어, Windows 기반 플랫폼에서 경로는 248 문자 미만이어야하며 파일 이름은 260 문자 미만이어야합니다. - 또는 -
name’는 cpio에 너무 길다.
sourcePath’에 있는 파일에는 링의 중간에 있는 열(:)이 포함되어 있습니다.
CreateEntry(스트리밍, 스트리밍)
아카이브 내에서 단일 입력을 만듭니다.
public CpioEntry CreateEntry(string name, Stream source)
Parameters
name
string
입구의 이름입니다.
source
Stream
입구에 대한 입력 스트림.
Returns
Cpio 입장 사례.
Examples
using (var archive = new CpioArchive())
{
archive.CreateEntry("data.bin", File.OpenRead("data.bin"));
archive.Save("archive.cpio");
}
Exceptions
name’ is null.
source’ is null.
name’ is empty.
DeleteEntry(CpioEntry)
입력 목록에서 특정 입력의 첫 번째 발생을 제거합니다.
public CpioArchive DeleteEntry(CpioEntry entry)
Parameters
entry
CpioEntry
입력은 입력 목록에서 제거해야합니다.
Returns
Cpio 입장 사례.
Examples
다음은 마지막을 제외한 모든 게시물을 제거하는 방법입니다 :
using (var archive = new CpioArchive("archive.cpio"))
{
while (archive.Entries.Count > 1)
archive.DeleteEntry(archive.Entries[0]);
archive.Save(outputCpioFile);
}
Exceptions
entry’ is null.
DeleteEntry(이트)
인덱스에 의해 입력 목록에서 입력을 제거합니다.
public CpioArchive DeleteEntry(int entryIndex)
Parameters
entryIndex
int
제거하려는 입력의 0 기반 지수.
Returns
입력된 파일이 삭제되었습니다.
Examples
using (var archive = new CpioArchive("two_files.cpio"))
{
archive.DeleteEntry(0);
archive.Save("single_file.cpio");
}
Exceptions
entryIndex’ is less than 0.-or-
entryIndex’ is equal to or greater than ‘Entries’ count.
Dispose()
응용 프로그램으로 정의된 작업을 수행하며, 관리되지 않은 자원을 배출, 배출 또는 재배치하는 것과 관련이 있습니다.
public void Dispose()
Dispose(바울)
응용 프로그램으로 정의된 작업을 수행하며, 관리되지 않은 자원을 배출, 배출 또는 재배치하는 것과 관련이 있습니다.
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
관리된 자원이 낭비되어야 한다.
ExtractToDirectory(스트리트)
아카이브에 있는 모든 파일을 제공된 디렉토리로 추출합니다.
public void ExtractToDirectory(string destinationDirectory)
Parameters
destinationDirectory
string
디렉토리로 이동하여 추출된 파일을 입력합니다.
Examples
using (var archive = new CpioArchive("archive.cpio"))
{
archive.ExtractToDirectory("C:\extracted");
}
Remarks
디렉토리가 존재하지 않는다면, 그것은 만들어집니다.
Exceptions
길은 0
지정된 경로, 파일 이름 또는 둘 다 시스템에 의해 정의 된 최대 길이를 초과합니다.예를 들어, Windows 기반 플랫폼에서 경로는 248 문자 미만이어야하며 파일 이름은 260 문자 미만이어야합니다.
호출자는 기존 디렉토리에 액세스 할 수있는 필요한 허가를 가지고 있지 않습니다.
디렉토리가 존재하지 않는 경우, 경로는 드라이브 라벨의 일부가 아닌 콜론 캐릭터 (:)를 포함합니다 (“C:”).
Path는 0 길이의 줄이며, 단지 흰색 공간을 포함하거나, 하나 이상의 취약한 캐릭터를 포함합니다. System.IO.Path.GetInvalidPathChars 방법을 사용하여 취약한 캐릭터를 요청할 수 있습니다. -or- path is prefixed with, or contains, only a colon character (:).
경로에 의해 지정된 디렉토리는 파일입니다. -or- 네트워크 이름은 알려지지 않습니다.
Save(링크, CpioFormat)
제공된 목적지 파일에 아카이브를 저장합니다.
public void Save(string destinationFileName, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
destinationFileName
string
만약 지정된 파일 이름이 기존 파일을 지정한다면, 그것은 과장됩니다.
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry1", "data.bin");
archive.Save("archive.cpio");
}
Remarks
아카이브를 동일한 경로로 저장할 수 있습니다.그러나 이 접근 방식은 일시적인 파일로 복사하는 것을 사용하기 때문에 이것은 권장되지 않습니다.
Exceptions
destinationFileName’ is a zero-length string, contains only white space, or contains one or more invalid characters as defined by System.IO.Path.InvalidPathChars.
destinationFileName’ is null.
지정된 destinationFileName’, 파일 이름, 또는 둘 다 시스템에 의해 정의 된 최대 길이를 초과합니다.예를 들어, Windows 기반 플랫폼에서 경로는 248 문자 미만이어야하며 파일 이름은 260 문자 미만이어야합니다.
지정된 destinationFileName’는 무효입니다 (예를 들어, 그것은 지도되지 않은 드라이브에 있습니다).
파일을 열 때 I/O 오류가 발생했습니다.
destinationFileName’Specified a file is read-only and access is not Read.-or- path specified a directory.-or- The caller does not have the required permission.
destinationFileName’ is in an invalid format.
Save(흐름, CpioFormat)
제공되는 스트림에 아카이브를 저장합니다.
public void Save(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
output
Stream
목적지 흐름
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream cpioFile = File.Open("archive.cpio", FileMode.Create))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry1", "data.bin");
archive.Save(cpioFile);
}
}
Remarks
글쓰기가 있어야 합니다.
Exceptions
output’ is null.
output’ is not writable. - or -
output’ is the same stream we extract from.- OR -It is impossible to save archive in
cpioFormat’ due to format restrictions.
SaveGzipped(흐름, CpioFormat)
gzip 압축을 사용하여 흐름에 아카이브를 저장합니다.
public void SaveGzipped(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
output
Stream
목적지 흐름
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream result = File.OpenWrite("result.cpio.gz"))
{
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveGzipped(result);
}
}
}
Remarks
글쓰기가 있어야 합니다.
Exceptions
output’ is null.
output’ is not writable.
SaveGzipped(링크, CpioFormat)
gzip 압축을 사용하여 파일에 파일을 저장합니다.
public void SaveGzipped(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
path
string
만약 지정된 파일 이름이 기존 파일을 지정한다면, 그것은 과장됩니다.
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveGzipped("result.cpio.gz");
}
}
저장소가 압축된(흐름, CpioFormat)
LZMA 압축으로 흐름에 아카이브를 저장합니다.
public void SaveLZMACompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
output
Stream
목적지 흐름
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream result = File.OpenWrite("result.cpio.lzma"))
{
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveLZMACompressed(result);
}
}
}
Remarks
글쓰기가 있어야 합니다.
중요: cpio 아카이브는 이 방법 내에서 압축되고, 그 내용은 내부적으로 보관됩니다.
저장소가 압축된(링크, CpioFormat)
lzma 압축을 통해 파일에 파일을 저장합니다.
public void SaveLZMACompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
path
string
만약 지정된 파일 이름이 기존 파일을 지정한다면, 그것은 과장됩니다.
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveLZMACompressed("result.cpio.lzma");
}
}
Remarks
중요: cpio 아카이브는 이 방법 내에서 압축되고, 그 내용은 내부적으로 보관됩니다.
SaveLzipped(흐름, CpioFormat)
Lzip 압축을 사용하여 흐름에 아카이브를 저장합니다.
public void SaveLzipped(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
output
Stream
목적지 흐름
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream result = File.OpenWrite("result.cpio.lz"))
{
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveGzipped(result);
}
}
}
Remarks
글쓰기가 있어야 합니다.
Exceptions
output’ is null.
output’ is not writable.
SaveLzipped(링크, CpioFormat)
Lzip 압축을 사용하여 파일에 파일을 저장합니다.
public void SaveLzipped(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
path
string
만약 지정된 파일 이름이 기존 파일을 지정한다면, 그것은 과장됩니다.
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveGzipped("result.cpio.lz");
}
}
SaveXzCompressed(스트림, CpioFormat, XzArchiveSettings)
xz 압축을 사용하여 스트림에 아카이브를 저장합니다.
public void SaveXzCompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii, XzArchiveSettings settings = null)
Parameters
output
Stream
목적지 흐름
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
settings
XzArchiveSettings
세트 설정 특정 xz 아카이브 : 사전 크기, 블록 크기, 체크 타입.
Examples
using (FileStream result = File.OpenWrite("result.cpio.xz"))
{
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveXzCompressed(result);
}
}
}
Remarks
흐름은 글쓰기가 있어야 합니다.
Exceptions
output’ is null.
output’ is not writable.
SaveXzCompressed(링크, CpioFormat, XzArchiveSettings)
xz 압축을 사용하여 경로에 대한 아카이브를 저장합니다.
public void SaveXzCompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii, XzArchiveSettings settings = null)
Parameters
path
string
만약 지정된 파일 이름이 기존 파일을 지정한다면, 그것은 과장됩니다.
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
settings
XzArchiveSettings
세트 설정 특정 xz 아카이브 : 사전 크기, 블록 크기, 체크 타입.
Examples
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveXzCompressed("result.cpio.xz");
}
}
저장소 압축(흐름, CpioFormat)
Z 압축으로 흐름에 아카이브를 저장합니다.
public void SaveZCompressed(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
output
Stream
목적지 흐름
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream result = File.OpenWrite("result.cpio.Z"))
{
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveZCompressed(result);
}
}
}
Remarks
글쓰기가 있어야 합니다.
Exceptions
output’ is null.
output’ is not writable.
저장소 압축(링크, CpioFormat)
Z 압축으로 경로로 아카이브를 저장합니다.
public void SaveZCompressed(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
path
string
만약 지정된 파일 이름이 기존 파일을 지정한다면, 그것은 과장됩니다.
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveZCompressed("result.cpio.Z");
}
}
SaveZstandard(흐름, CpioFormat)
스탠다드 압축을 사용하여 스트림에 아카이브를 저장합니다.
public void SaveZstandard(Stream output, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
output
Stream
목적지 흐름
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream result = File.OpenWrite("result.cpio.zst"))
{
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveZstandard(result);
}
}
}
Remarks
글쓰기가 있어야 합니다.
Exceptions
output’ is null.
output’ is not writable.
SaveZstandard(링크, CpioFormat)
스탠다드 압축을 사용하여 파일에 파일을 저장합니다.
public void SaveZstandard(string path, CpioFormat cpioFormat = CpioFormat.OldAscii)
Parameters
path
string
만약 지정된 파일 이름이 기존 파일을 지정한다면, 그것은 과장됩니다.
cpioFormat
CpioFormat
cpio header 형식을 정의합니다.
Examples
using (FileStream source = File.Open("data.bin", FileMode.Open, FileAccess.Read))
{
using (var archive = new CpioArchive())
{
archive.CreateEntry("entry.bin", source);
archive.SaveZstandard("result.cpio.zst");
}
}