Developing File Systems for linux, mac, windows
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.
Best linux filesystem filter option?
I have chosen RedirFS Redirecting Filesystem Framework.
- similar to windows minifilter drivers in many ways
- simple enough and featurefull
- has examples of programs
- nice docs (but scattered)
How to trap file access attempts with a filter driver (kernel) and offer dialog to allow/deny (user)?
You (a.k.a. I) have pretty much enumerated the possibilities. Either poll the way FileMon does, or pass an event. Passing the event is probably a bit more error prone, and if you aren't a threading guru then there's probably more chance for error. But if you tend to make lots of mistakes then device drivers may not be for you...skydiving might be a poor choice too.
I'll offer taking a look at this project, but please note the disclaimers in the README. (It is only a test and investigation):
https://github.com/hostilefork/CloneLocker
And yes, to the extent that Microsoft and their driver model is to be something one worries about, miniFilters are the better choice these days.
Related Topics
How to Delete X Number of Files in a Directory
Qfiledialog: How to Filter Only Executables (Under Linux)
How Does One Override an Existing Zsh Keyboard Completion
How to Get "Instant" Output of "Tail -F" as Input
Tail a Log into an Excerpt in Real Time
PHPmyadmin Mcrypt Extension Is Missing
"Segmentation Fault (Core Dumped)" Error in Fortran Gfortran Linux
Downloading a Tarball from Github Without Curl
Trying to Install Docker Gpg Key Recieving Error: Curl: Option '-' Is Unknown
How to Configure Multiple Ssh Access to an Ec2 Instance
Bash Script to Compile and Run C++ Program
Split Tar.Bz2 File and Extract Each Individually
How to Store Multiple Pats/Passwords for Use by Git
Process Scheduling from Processor Point of View
How to Reset Tty After Exec-Ed Program Crashes