Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there such a thing as a file system mask?

I'm thinking of Mask as in a circuit Mask (I think)- let me explain with a handy chart

mask chart

The common source would be physically in c:\source

Instance A would be physically in c:\instanceA but initially have nothing but symlinks to everything in c:\source

Instance B would be physically in c:\instanceB but initially have nothing but symlinks to everything in c:\source

As you made changes to Instance A and Instance B, you would have create a mask that would hide files from CommonSource if they were deleted from the Instance folders and create a new physical file in the instance directory if an existing Common Source file was modified. New files would live in the instance folders but never make it back to the Common Source.

This type of setup would be very useful for a project where I want to do many different types of small tweaks to multiple instances where distinct threads would work on distinct instances.

I know about symbolic links but they fall short in the case of modifying a file.

Is there anything that can accomplish this? If not, should I try to make this and patent it? Seems like a good idea to me.

I would be on Windows Server 2008 or later.

like image 968
Matt Avatar asked Jul 11 '12 00:07

Matt


2 Answers

Fearing I'm stating the obvious, but git is one tool that can be used to achieve this behavior.

  1. Make your "Common Source" a git repository
  2. Clone the repository twice to "InstanceA" and "InstanceB"
  3. In each instance, check out a new, unique branch

As changes are made in "Common Source" you can merge those changes into "InstanceA" and "InstanceB" while maintaining the "MASK" (changes to the branch) you've created for each.

This has the added benefit of allowing changes from "Common Source" to be pulled as you wish instead of having changes to "Common Source" pushed out to each instance (something I imagine would be less desirable and more prone to error).

like image 148
deefour Avatar answered Sep 26 '22 21:09

deefour


You're looking for a union mount. Unfortunately, I'm not aware of any implementations for Windows, but there are several available for Linux, notably UnionFS.

In general they are used for making a read-only filesystem look like it's read-write: typically on live-CDs.

like image 25
Andrew Aylett Avatar answered Sep 23 '22 21:09

Andrew Aylett