What technologies do applications such as dropbox (http://www.dropbox.com/) and expandrive (http://www.expandrive.com/mac) use to build functionality right into the local filesystems on each platform? Can anyone suggest anything that would allow for maximum code reuse on all of the major platforms?
I’ve only looked into FUSE on linux so far and I like what I see.
Implementing a virtual file system is very OS-specific. The reason is that architecture of drivers is different in Unix-like OS and in Windows.
To avoid writing your own driver, you can use user-mode file system toolkit. On Linux, BSD and MacOS there exist FUSE and OSXFUSE (fork of now-inactive MacFUSE) respectively. On Windows our Callback File System is used.
Dropbox at the moment doesn’t have a virtual file system but only shell extension (afaik they planned to create a virtual disk but I don’t know what they have decided).
Regarding how file changes are tracked: there exist several methods. The simplest is to scan the directory on timer and compare timestamps and file sizes. Next, one can use FindFirstChangeNotification WinAPI function. And the most sophisticated and most reliable method is to use a filesystem filter driver. On Windows our CallbackFilter can be used. On MacOS X and on Linux you can get post-notifications similar to what FileSystemWatcher offers in .NET/Windows. In particular, on Linux, one can use inotify.