EN JA
ARCHIVE_READ_FORMAT(3)
ARCHIVE_READ_FORMAT(3) FreeBSD Library Functions Manual ARCHIVE_READ_FORMAT(3)

名称

archive_read_support_format_7zip, archive_read_support_format_all, archive_read_support_format_ar, archive_read_support_format_by_code, archive_read_support_format_cab, archive_read_support_format_cpio, archive_read_support_format_empty, archive_read_support_format_iso9660, archive_read_support_format_lha, archive_read_support_format_mtree, archive_read_support_format_rar, archive_read_support_format_raw, archive_read_support_format_tar, archive_read_support_format_xar, archive_read_support_format_zipストリーミングアーカイブを読み込むための関数

ライブラリ

ストリーミングアーカイブライブラリ (libarchive, -larchive)

書式

#include < archive.h>

int
archive_read_support_format_7zip( struct archive *);

int
archive_read_support_format_all( struct archive *);

int
archive_read_support_format_ar( struct archive *);

int
archive_read_support_format_by_code( struct archive *, int);

int
archive_read_support_format_cab( struct archive *);

int
archive_read_support_format_cpio( struct archive *);

int
archive_read_support_format_empty( struct archive *);

int
archive_read_support_format_iso9660( struct archive *);

int
archive_read_support_format_lha( struct archive *);

int
archive_read_support_format_mtree( struct archive *);

int
archive_read_support_format_rar( struct archive *);

int
archive_read_support_format_raw( struct archive *);

int
archive_read_support_format_tar( struct archive *);

int
archive_read_support_format_xar( struct archive *);

int
archive_read_support_format_zip( struct archive *);

解説

archive_read_support_format_7zip(), archive_read_support_format_ar(), archive_read_support_format_cab(), archive_read_support_format_cpio(), archive_read_support_format_iso9660(), archive_read_support_format_lha(), archive_read_support_format_mtree(), archive_read_support_format_rar(), archive_read_support_format_raw(), archive_read_support_format_tar(), archive_read_support_format_xar(), archive_read_support_format_zip()
指定されたアーカイブ形式のための --- 自動検出コードを含む --- サポートを有効にします。例えば、 archive_read_support_format_tar() は、様々な標準の tar 形式、古いスタイルの tar、ustar、pax 交換形式と多くの共通の変異型のサポートを有効にします。
archive_read_support_format_all()
“raw” (生の) 形式以外のすべての利用可能な形式のサポートを有効にします (下記参照)。
archive_read_support_format_by_code()
書式コードによって指定された単一の形式を有効可能にします。単一のアーカイブを 2 度読み込むとき、これは、便利です。最初に読み込んだ後に archive_format() を使用し、必要な形式のサポートのみを選択的に有効にするために、この関数へ結果のコードを渡します。注: 静的にリンクされた実効形式で、これによって、利用者のプログラムが、すべての形式のためのサポートを含めます。実行形式のサイズが関係するなら、この関数を使用しないほうがよいかもしれません。
archive_read_support_format_empty()
空のアーカイブとして空のファイルを扱うためのサポートを有効にします。空のファイルは、いくつかの異なる形式で有効であるので、純粋に内容に基づいた空のファイルのための形式を正確に決定することはできません。それで、空のファイルは、別個の形式として libarchive によって扱われます。
archive_read_support_format_raw()
“raw” (生の) 書式ハンドラによって、libarchive を任意のデータを読み込むために使用することができます。それは、単一のエントリでアーカイブとしてあらゆるデータストリームを扱います。このエントリのパス名は、“data”です。他のすべてのエントリフィールドは、未設定となります。これは、ダメージを受けたアーカイブの間違った処理を回避するために archive_read_support_format_all() によって有効にされません。

戻り値

これらの関数は、成功すれば、 ARCHIVE_OK を返すか、または ARCHIVE_FATAL を返します。

エラー

詳細なエラーコードとテキスト形式の記述は、 archive_errno() と archive_error_string() 関数から利用可能です。

バグ

多くの古いアーカイバプログラムは、有効な空のアーカイブとして空ののファイルを扱います。例えば、 tar(1) の多くの実装によって、利用者は、空のファイルにエントリを追加することができます。もちろん、内容を検査することによって空のファイルの形式を決定することはできないので、このライブラリは、特別の“empty”形式があるとして空のファイルを扱います。

他のハンドラとともに“raw” (生の) ハンドラを使用することは、しばしば動作しますが、驚くべき結果となるかもしれません。

February 2, 2012 FreeBSD