file in abyss
フォーマット一覧へ戻る

Data

INI INI Configuration

設定ファイルで広く使われるセクションとキー値のテキスト形式。Windowsや多くのツールで使われます。

Extensions .ini, .conf, .cfg
MIME text/plain

マジックナンバー

ファイルを解析
オフセット 0 このサイトのINIサンプルで使うセクション
5B 73 61 6D 70 6C 65 5D
[sample]

構造

  1. Sections
  2. Key-value pairs
  3. Comments

注意点

  • INIは方言が多く、コメント文字やエスケープ規則が実装ごとに異なります。

判定コード例

SIGNATURE = bytes.fromhex("5b73616d706c655d")
OFFSET = 0

def is_ini(path: str) -> bool:
    with open(path, "rb") as f:
        f.seek(OFFSET)
        head = f.read(len(SIGNATURE))
    return head == SIGNATURE

実践的な使い方

ユースケース

INI Configuration はデータ交換、インポート/エクスポート、パーサのテスト、検証ワークフローで使われます。エンコーディング・区切り文字・バージョン・コンテナ構造が実装の挙動を変えることがあります。

よくある判定ミス

  • .ini / .conf / .cfg という拡張子だけではファイルの中身を保証できません。アップロードや変換の処理では、拡張子・MIMEタイプ・先頭バイト・形式固有の構造チェックを組み合わせるべきです。
  • INI Configuration は 5B 73 61 6D 70 6C 65 5D のようなシグネチャで始まりますが、関連するコンテナや破損ファイルでは追加の検証が必要になる場合があります。

セキュリティ上の注意

形式が判定できたからといって、信頼できない入力が安全とは限りません。パーサ例外・巨大ファイル・想定外のエンコーディング・外部参照を考慮してください。

サンプルの活用

11 個のサンプルで、先頭バイト判定・パーサのエラー・アップロード上限・ダウンロード挙動をテストできます。

サンプルファイル

11 / 11 files
Sample Traits Size Source / license / SHA-256
Data

Blue Sky INI

Blue Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

01-blue-sky.ini
Type Sample
Small file
159 B
SHA-256 5390986ec25e1dcc50005c53502b63a293c5b4bee6481ccda0aec4b9b27aa38f
Download
Data

Flower Garden INI

Flower Garden INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

02-flower-garden.ini
Type Sample
Small file
256 B
SHA-256 0d455776327b7f8c380abc20446c6aeb3174645ea4e0e9f1057ca7eb452f9c46
Download
Data

Navy Blue Sky INI

Navy Blue Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

03-navy-blue-sky.ini
Type Sample
Small file
297 B
SHA-256 753d1c06b41a2fc055122dd24d90a571b3ce03f54cb4370ff1fa9454e51d6492
Download
Data

Nature of the Sky INI

Nature of the Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

04-nature-sky.ini
Type Sample
Small file
354 B
SHA-256 adcd4cc0325b644736310105256c77af44db4919fa9cea2c31e758c2620df943
Download
Data

Sky Landscape INI

Sky Landscape INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

05-sky-landscape.ini
Type Sample
Small file
458 B
SHA-256 293916ec89df7044fc3316b739c64399c67118841b93531ce884335b009b8448
Download
Data

Starry Sky INI

Starry Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

06-starry-sky.ini
Type Sample
Small file
400 B
SHA-256 ed8cf89e846fbbc88bc02f3b5097547826718feda363fffcd672f40f1f479f01
Download
Data

Blue Night Sky INI

Blue Night Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

07-blue-night-sky.ini
Type Sample
Small file
504 B
SHA-256 8fca89858072b208f983603607f87302eadb5a167c115f78de17609bd3cb7f23
Download
Data

Hibiscus Flower INI

Hibiscus Flower INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

08-hibiscus-flower.ini
Type Sample
Small file
679 B
SHA-256 e5b555c7d83a19837d888e086c27e8acbffc7fbde1a3f5faabf8ac9e68749b1f
Download
Data

Arctic Sky INI

Arctic Sky INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

09-arctic-sky.ini
Type Sample
Small file
612 B
SHA-256 4351d21df768292f6dc8f010686d84120bfe015a7f9c436f7b14bb82e5f634c2
Download
Data

Sunset Rays INI

Sunset Rays INI is a INI Configuration sample based on Wikimedia Commons. It can be used to test downloads, parsers, previews, and file type detection.

10-sunset-rays.ini
Type Sample
Small file
680 B
SHA-256 36685bc27e8418c2dffe2e6ea5a9ece1c21efeb009ced7c28dbed22dd4bd590d
Download
Data

NASA Blue Marble INI

NASA Blue Marble INI is a INI Configuration sample based on NASA Image and Video Library. It can be used to test downloads, parsers, previews, and file type detection.

nasa-blue-marble-2012-east.ini
Type Sample
1.2 KB
SHA-256 74de688d81b9ef2c50a3659225d5b16cdc1bdd0a954b5181a7e119bf9b58b957
Download

よくある質問

INI Configuration のマジックナンバー(ファイルシグネチャ)は?

INI Configuration ファイルはバイトシグネチャ 5B 73 61 6D 70 6C 65 5D ("[sample]") で始まります。拡張子に頼らず、この先頭バイトを読み取って形式を判定してください。

INI Configuration のMIMEタイプは?

INI Configuration のMIMEタイプは text/plain です。

INI Configuration の拡張子は?

INI Configuration ファイルは .ini, .conf, .cfg 拡張子を使います。拡張子は慣習にすぎず中身を保証しないため、シグネチャや構造のチェックと組み合わせてください。

関連フォーマット