25行でファイルシステム
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を使用してオリジナルファイルシステムを作ってみてください。

Employment JObs…
[...]here are some links to sites that we link to because we think they are worth visiting[...]…
Nice article , thank you for sharing your article. I genuinely enjoyed it. I place a url to my website to right here so other group men and girls can research it.
Hi, I have been searching everywhere for a tutorial on making fabric covered rings. This is the closest thing Ive found. Any suggestions on turning it into a ring? Also, where did you get your kit? Thank you!!