Dokanライブラリ0.1.1をリリース
October 8th, 2007 in Dokan by 淺川
Dokanライブラリ0.1.1をリリースしました。
まれにブルースクリーンになる問題が修正されています。Downloadページからダウンロードできます。
Dokanライブラリ0.1.1をリリースしました。
まれにブルースクリーンになる問題が修正されています。Downloadページからダウンロードできます。
Dokan RubyバインディングのFuseFS互換インタフェースを利用すると、25行でファイルシステムを書くことが出来ます。
dokanとdokan-rubyをダウンロードして、dokan.sys dokan.dll mounter.exe dokan_lib.so dokanfs.rbを同じディレクトリに置いて、次のようなプログラムを書きます(dokan-ruby\sample\hello.rbにあります)。
require 'dokanfs'
class Hello
def initialize
@msg = "hello, world"
end
def contents path
["hello.txt"]
end
def file? path
path =~ /hello.txt/
end
def directory? path
path == "/"
end
def read_file path
@msg
end
def size path
@msg.length
end
end
FuseFS.set_root(Hello.new)
FuseFS.mount_under("r")
FuseFS.run
実行してみます。
> ruby hello.rb
すると、Rドライブが作成され、Rドライブを開くとhello.txtというファイルがあります。これを開くとhello,worldと書かれています。アンマウントするには、
> dokanctl.exe /u r
を実行します。
Dokan Rubyを使うと、非常に手軽にファイルシステムが作成出来ます。ぜひみなさんも、Rubyを使用してオリジナルファイルシステムを作ってみてください。

Dokanライブラリ0.1.0とDokan Rubyバインディング0.1.0をリリースしました。Dokanライブラリは、Windowsでユーザモードファイルシステムを実現するためのライブラ リです。Dokan Rubyバインディングは、 Ruby言語でファイルシステムを作成するためのライブラリです。Downloadページからダウンロードできます。
近々Dokan .NETバンディングとSSHFSを公開予定です。お楽しみに。
Recent Comments