This is a mirror of official site: http://jasper-net.blogspot.com/

FUSE(file system in userspace) for MS-SQL using C#

| Sunday, August 22, 2010
Introduction

Every time I use Linux, I feel a piece of jealousy to see its filesystems. Not only NTFS, FAT32, but huge palette of data storages included GDocs etc. Now I can raise head up! Dokan rocks!

What is Dokan?

What Dokan is? Simply device driver encapsulated filesystem calls. By using proxy functions gives programatically create response for ReadFile, WriteFile, FindFiles and other core I/O operations. Even on .NET! There are also Dokan.NET interface for using C#.
Now you are enable to write your own filesystems. You can create your own filesystem or you can be inspired by another applications using Dokan . What about filesystem using memory as ramdisk, system used encrypted file as data storage? Mirroring of some disc or directories, access to registry via filesystem, list of processes as files on attached disk? Open your mind and try to find another use for Dokan. This article will help you. You will be able to store your files on MS SQL database, copy, rename, update, delete etc. Simply file versioning is also included. This was reason why I started play with Dokan. Create external storage with some versioning, mounted as disk, easy to use for end users. To create version of file, just add extension ".version" to the end of filename and copy to disk. File will be renamed to previous extension and previous version of file receive version number. You can choose if you want to see all versions or only actual version.

Prerequisities

Installed Dokan.
Download actual version (0.53) from Dokan main pages and install. (code was tested with version 0.52)

Prepared MS-SQL
For testing purposes is suitable MS-SQL Express edition on your PC, but I used SQL server located on virtual machine to simulate some network traffic and network accidents. For production be carefull and create special user account and allow to run stored procedures for this account. Do not miss this step. It is good security strategy.
On SQL machine run metadata script to create stored procedures used by C# application and create table "DOKANFS", main and only table using by your app. If you want to use another table, you have to rename all occurences in all stored procedures.
VS 2008 Standard edition. If you have Express edition, you have to use MS-SQL Express on you machine. Express edition doesn`t allow remote connection to MS-SQL server.

Read more: Codeproject

Posted via email from .NET Info

0 comments: