Dropbox及其“文件夹”像设计 [英] Dropbox and its "Folder" like design

查看:130
本文介绍了Dropbox及其“文件夹”像设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从程序员的角度来看,最好在C#或Java中,我想知道如何操作操作系统中的文件夹来做你想做的事情,比如像FTP一样行事?



图片http://www.jacks-log.de/wp-content/uploads/2011/02/Dropbox-Wurmloch-1.png



由于我在几年前听说过dropbox,我一直在想知道做这件事情是什么? 解决方案

谈论Dropbox ,他们不会做任何棘手的事情 - 只是使用Windows用户模式API提供的机制监视常规文件夹。然而,使用内核模式驱动程序可以做更多更强大和有趣的事情。

您可以做的第一件事是创建一个虚拟磁盘并将其映射到该文件夹​​。这样,您的代码(在我们的产品帮助下,内核模式或用户模式)将能够处理针对该文件夹中的文件的所有操作系统请求。该文件夹不会在磁盘上存在,但将是虚拟的。您可以随时从远程服务器中选择数据,将它们写入远程服务器等。特别是,您可以将远程SFTP服务器映射到该文件夹​​(使用FTP时,由于FTP不支持部分上载,所以事情会更复杂一些)。一些云提供商完全按照我所描述的方式进行操作 - 他们提供虚拟磁盘或虚拟文件夹,这是云服务的门户,当您从此类虚拟文件夹或磁盘读取或写入数据时,数据会从云端传输到云端服务器。



接下来是在文件系统过滤器驱动程序的帮助下,您可以拥有一个真实文件夹,但动态提供文件内容。这是一些文件夹加密程序的工作方式(它们在将文件数据写入实际磁盘时加密文件数据,如果未激活此加密程序,则只会从此文件夹中的文件读取加密的垃圾)。

现在,使用文件系统过滤器驱动程序,您可以控制访问文件夹的人员和方式,例如,您可以对访问文件夹内容进行精细控制(将其与加密和你会得到一个方便的数据保护机制)。

I was wondering from a programmers perspective preferably in C# or Java, how hard is it to manipulate a folder within the operating system to do what you want, for instance to act like an FTP?

image http://www.jacks-log.de/wp-content/uploads/2011/02/Dropbox-Wurmloch-1.png

Since I heard of dropbox a few years ago, I've always been wondering whats involved in doing this?

解决方案

Talking about Dropbox in particular, they don't do anything tricky - just a regular folder being monitored using the mechanisms provided by Windows user-mode API.

It is possible to do much more powerful and interesting things using kernel-mode drivers, though.

First thing you can do is create a virtual disk and map it to the folder. This way your code (either kernel-mode or user-mode with help of our products) will be able to handle all OS requests coming for files in this folder. The folder won't exist on the disk but will be virtual. You can pick data from the remote server on the fly, write them to the remote server etc. In particular, you can map a remote SFTP server to the folder (with FTP things are a bit more complicated as FTP doesn't support partial uploads). Some cloud providers do exactly what I described - they offer a virtual disk or a virtual folder which is a "gate" to their cloud service, and when you read or write data from such virtual folder or disk, data goes from/to the cloud server.

Next thing is that with help of the filesystem filter driver you can have a real folder but provide file contents dynamically. This is how some folder encryptors do (they encrypt file data when writing it to the real disk and without this encryptor active you will read just encrypted "junk" from files in this folder).

Now, with filesystem filter driver you can control who and how can access the folder, i.e. you get fine-grain control over access to folder contents (combine this with encryption and you get a handy data protection mechanism).

这篇关于Dropbox及其“文件夹”像设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆