开源项目egfs

在[url]http://projects.trapexit.org/web/#/web/index/all/name/asc/225[/url]发现了一个开源项目egfs[url]http://code.google.com/p/egfs/[/url],与俺的efs目的类似,同时发现了fuserl和fuserldrv,完成了fuse的erlang port驱动(support port+linkedin port),可以试试。

安装完毕后,在.erlang下面加入fuserl的代码路径:
[quote]
code:add_patha("...").

include_lib is similar to include, but should not point out an absolute file. Instead, the > first path component (possibly after variable substitution) is assumed to be the name of an > application. Example:

-include_lib("kernel/include/file.hrl").

The code server uses code:lib_dir(kernel) to find the directory of the current (latest) > version of Kernel, and then the subdirectory include is searched for the file file.hrl.
[/quote]


erl +A 64
> application:start(fuserl).
> application:start(fuserlproc).
> file:list_dir("/erlproc").

gj@uss:~$ ll /proc/21270/fd
total 0
lrwx------ 1 gj gj 64 2010-02-20 11:24 0 -> /dev/pts/4
lrwx------ 1 gj gj 64 2010-02-20 11:24 1 -> /dev/pts/4
lrwx------ 1 gj gj 64 2010-02-20 11:24 2 -> /dev/pts/4
lr-x------ 1 gj gj 64 2010-02-20 11:24 3 -> pipe:[294864]
l-wx------ 1 gj gj 64 2010-02-20 11:24 4 -> pipe:[294863]
lrwx------ 1 gj gj 64 2010-02-20 11:24 5 -> /dev/fuse

open_port ({ spawn, Dir ++ "/bin/fuserldrv" }, [ binary,
{ packet, 4 },
nouse_stdio,
exit_status ]);

# pstree -ap

├─gnome-terminal,12461
│ ├─bash,12465
│ │ └─vim,24326 mds/mds/main.c
│ │ ├─cscope,24360 -dl -f ../../cscope.out
│ │ └─{vim},24327
│ ├─bash,13467
│ │ └─su,14662
│ │ └─bash,14663
│ │ └─vim,19922 ./lib/mount.c
│ │ └─{vim},19923
│ ├─bash,15897
│ ├─bash,19578
│ ├─bash,19680
│ ├─bash,21147
│ │ └─beam.smp,25268 -A 2 -- -root /usr/local/lib/erlang -progname erl -- -home /home/gj --
│ │ ├─fuserldrv,25290
│ │ ├─{beam.smp},25272
│ │ ├─{beam.smp},25273
│ │ ├─{beam.smp},25274
│ │ ├─{beam.smp},25275
│ │ ├─{beam.smp},25276
│ │ ├─{beam.smp},25277
│ │ ├─{beam.smp},25278
│ │ └─{beam.smp},25279


libfuse与fuse kernel module用打开/dev/fuse返回的fd进行通信。
在open_port时指定选项nouse_stdio,现在外部程序用fd 3 && 4与模拟器进行通信。
外部程序fuserldrv是beam.smp的子进程。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值