I have a web service which allows the users to upload and keep track of their files on the server. What I want to do is create some sort of application which recreates my "online file system" on the local machine. Kind of like having a folder on my desktop which presents the files I have on the webserver, where I can move them, open, save, etc. If you know Dropbox you get the idea of what I want to accomplish.
My problem is that开发者_StackOverflow中文版 I have no clue on where to start to develop this. I guess I could go for some sort of Nautilus extension, but then I would be dependent of that file manager so I think it should be something implemented directly in the OS' filesystem.
I have already figured out how to do this on Windows (http://msdn.microsoft.com/en-us/magazine/cc188741.aspx) and it seems pretty straight forward.
So what I want to know is if anyone here has experience in doing this on Linux and whats the best way to do it.
Thanks.
You can use use fuse to make a virtual file system: wikipedia, sourceforge. Here's a tutorial and another for python
It emulates a drive so it will work in the shell or nautilus or anything else.
There is also a Mac port so it could work there too.
If you want to develop this by yourself, use fuse
http://fuse.sourceforge.net/
But if I were in you, I would try first in searching an already existing solution with fuse, depending on the capabilities of your server.
HIH
As others have already suggested, you should be able to use Fuse.
You don't specify how your web service works, but if it's WebDAV-based (which would make sense for this type of application), then you could use existing Fuse modules for WebDAV such as davfs2.
Before you go ahead and create you own yet-another-network-filesystem I would recommend you look at what's already out there.
The first thing that comes to mind is ssh/scp/sftp. On modern unix (BSD, Solaris, Linux, MacOSX etc) the ssh daemon comes pre-installed by default. You just need to write scripts to manage user accounts from your web application.
If it HAS to be a web based thing then look at WebDAV. You can run WebDAV using most web servers. There is already a WebDAV filesystem on Linux and it looks like it is even built-in to Windows XP and above: winnt webdav network drive.
Box.net is one such service using WebDAV.
Check out http://www.dropbox.com/
精彩评论