Tuesday, May 27, 2008

Windows FUSE "Dokan" become open source !!


Yesterday, Dokan - Windows FUSE - become open source (LGPL)!

http://decas-dev.net/en/2008/05/26/open-source-dokan-library-032-released/

FUSE is "File system in User space". Usually, you have to write code for kernel mode to make file system. FUSE is a library which callbacks from the kernel mode to the user mode when there is a access to the file system. With FUSE, creating file system gets extremely easy.

There is a FUSE for Linux and Mac OS X. But there were no FUSE for Windows for a long time. Currently, most of the kernels of OS is open source, but Windows kernel is still close source. Making FUSE for Windows is difficult task, because information is not enough. But Hiroki Asakawa created it !!! Wow !!! It looks simple, but you will know how diffcult it is if you try to make it.

For Dokan, I can make softwares which I wanted to make for a few years!

As Dokan become open source, I improved it for 5 points.

1. Support Windows 2000

I don't know why, but Dokan doesn't work on Windows 2000. So I made a patch.

http://accelart.jp/dokan/20080527/sys.patch

It's a patch for device driver, but you need to recompile user mode application, such as NT service. I checked that I can launch Firefox with the next mirror patch.

2. Add "-noLockOnSource" option to mirror file system

Dokan has the sample "mirror". This samples creates mirror file system. But if you mirror completely, there will be a strong lock to the mirrored file, when you execute exe files. Then you cannot launch exe applications on mirror file system. At first, I didn't notice that this is a lock problem. I thought this is a Dokan bug. So I add -noLockSource option to mirror file system, which doesn't lock on mirrored files.

mirror.exe -noLockOnSource "C:\Program Files\Mozilla Firefox" S:

With this command, I checked that I can launch Firefox by S:\firefox.exe

http://accelart.jp/dokan/20080527/mirror.patch

3. Java Wrapper - JDokan

Dokan can use C, .NET, Ruby. I also added to support Java. The name is JDokan, and the license is LGPL.

http://accelart.jp/dokan/20080527/JDokan.zip

4. MemoryFS

With JDokan, I created a file system on memory. It's a file system version of a RAM Disk. As same as mirror file system, I checked that I can launch Firefox from MemoryFS. This is included in JDokan.zip. The license is MIT license.

5. JSFlickrFS

This might be the first file system written by JavaScript in history. I made Flickr can be read as a file system. I used Rhino. This is also included in JDokan.zip. The license is MIT license.

Launch mount.bat



Make 3 folders.



Three folders are created.



If you open T:\france, you can see thumbnails, which is downloaded from Flickr.

17 comments:

l3opard said...

I am really glad that Dokan is spreading like a wild fire. I would like to know if there is a way to support symbolic links in Dokan sshfs? Something similar to the option -follow symlinks in macFUSE.
Any insights will be appreciated.

yukoba said...

Sorry I'm not the creater of Dokan sshfs. Please ask to Asakawa, the creator of sshfs.

Federico said...
This comment has been removed by the author.
Federico Bianchi said...

This is actually a weak point in the mapping: symlinks are not supported natively on Windows systems, while on MacOS/X they are present in the underlying BSD layer.

NTFS actually allows users to make POSIX standard _hard_ links or so-called "junctions" (which may be seen as symlinks to a reparse point); moreover, ever since its introduction with Windows 95 the Explorer shell has a alias-like mechanism called "shortcut". None of them always has the exact POSIX symlink behaviour.

As a matter of reference, POSIX compatibility layers like Cygwin or the SFU (now SUA)subsystem do handle symlinks correctly - but they can be used only by their applications.

Anyway, Dokan is really nice - I discovered just a few days ago and am very pleased with SSHFS

Anonymous said...

@Federico Bianchi:

Not entirely true. Windows Vista supports symlinks AND hard links.

Like you pointed out, the POSIX SS of Windows does support symlinks, and so does the Cygwin; but these mechanisms are emulated on top of the Windows NT filesystem.

Federico Bianchi said...

You are definitely right w.r.t.NT 6.x (Vista or 2008 Server), but losing XP compatibility now just to add proper symlink support would be a draconian solution. As a matter of reference, here in Italy there are still *many* Windows 2000 in use, while I have seen very few non-OEM Windows Vista (often in dual boot environments).

Anonymous said...

Take a look at this porting attempt: http://fuse4win.4host.ru/

Anonymous said...

Could you plase provide some steps how to install your patch for using Dokan with Windows 2000.
You can mail me spaz999[at].gmail.com
Thanks a lot.

Anonymous said...

Thanks for writing JDokan.

I am using vista on intel 3.2 GHz w/ HT with 2GB of memory.

I have tried MemoryFS. I could get a maximum of 1.8 MB/s writing speed, which is very very much slow for a RAM disk. While On linux when I tried ramfs, i could get 980 MB/s writing speed.

Please tell me that whether JDokan is good for me, as I am developing a driver for my own prototype file system.

Anonymous said...

Is there any filesize restriction in JDokan. I cannot copy large files to MemoryFS on vista.

Nahuel said...

Hello Yukoba:

Congrulations for Jdokan.

I'm doing a project for Genos Open Source in Spain with JDokan and I don't know if you know it but I found a bug in your Sample Application MemoryFS. I found while I was working with the rar format. If you would like to know just email me to nahuelsgk@gmail.com and I would like to explain you in just few lines.

Nahuel.

Thomas said...

Hi Yukoba,

the company I work for is interested in using JDokan. I'd be interested to know if you are still working on JDokan, etc. It would be great if you could contact me jdokan@devotek-it.ch

Anonymous said...

Hi,

We are very interested in using and contributing to JDokan. Are you still active on the project ?

Please contact us at support@object-matrix.com ?

Thank you

Riduidel said...

Hi,
would you be interested in having JDokan ported to google code (for easier sharing of code) and to maven architecture (for easier integration in enterprise applications) ? I can do the fork alone, but I largely prefer to have your agreement.
Thanks.

yukoba said...

I'm sorry for not replaying to many people's comments.

I have no plan to improve JDokan, and I wish others will improve this.

Mr. Riduidel,
I'm grad if you upload this to Google Code. Could you tell me the URL after you upload it to Google Code?
I'will write the link to this blog post.
Thank you!

Anonymous said...
This comment has been removed by a blog administrator.
jia kai said...

I tried JSFlickrFS and MemoryFS, the local disk S and T did appear but I can't see anything inside. May I know why ?