On Sat, 26 Sep 2009, Paul Chitescu wrote: [...]
What you're proposing here is essentially an overlay file system.
[...]
You should also know that any such simplistic approach can fail in interesting and hardly to debug ways unless the user's prefix is wiped (which you already noted) which is unacceptable in most scenarios.
Here's a nice reference on the traps awaiting anyone who wants to write a union filesystem:
http://lwn.net/Articles/324291/
Also note that in the case of Wine a union filesystem does not solve the problem of the registry since it would not know how to merge the content of the administrator's and the user's system.reg files. So to make the unioning complete we would need a union registry too (or make each registry key and value into its own directory/file!).