[Gauche] magicモジュール バージョン0.1公開

概要

magicモジュールは、libmagicのGaucheバインディングです。

動作環境

magicモジュール バージョン0.1は、Ubuntu Linux 7.10, Gauche 0.8.13, libmagic 4.21-1で動作を確認しています。

ダウンロード

以下のURLからダウンロードできます。

インストール

ダウンロードしたファイルを展開したら、

$ ./configure && make install

してください。

使い方

以下を参考にしてください。

$ gosh
gosh> (use magic)
#<undef>
gosh> (magic-filename "Makefile")
"ASCII text"
gosh> (magic-filename-mime "Makefile")
"text/plain; charset=us-ascii"
gosh> (use file.util)
#<undef>
gosh> (define buffer (file->string "Makefile"))
buffer
gosh> (magic-string buffer)
"ASCII text"
gosh> (magic-string-mime buffer)
"text/plain; charset=us-ascii"

詳しい使い方は、ソースコードを参照してください。