"Junctioned" symbolic links
3
votes
2
answers
1062
views
Does Linux have the capability to use "junctioned" symbolic links? I'm not sure if this is an actual term or not, so let me explain the concept.
I have a git repository containing all my configuration dot files in
~/dotfiles
. I use symbolic links into this directory in order to "activate" them. For example, by executing ln -s ~/dotfiles/bash/bash_profile ~/.bash_profile
to produce the link:
~/.bash_profile -> ~/dotfiles/bash/bash_profile
However, I find myself in a situation where I want to combine the contents of multiple files. For example, I want the ~/.bash_profile
symbolic link to point to two separate files, one for each project. E.g.:
~/.bash_profile
(1) -> ~/dotfiles/bash/bash_profile
(2) -> ~/dotfiles/proj/bash_profile
I know I can simply concatenate the two files (e.g., cat ~/dotfiles/{bash,proj}/bash_profile > ~/.bash_profile
), but if I can do the same thing with symbolic links, I would prefer to.
I imagine that if such a feature exists (Nix is pretty huge), then under the hood it would have to map the two different files together, hiding all sorts of complexities under the hood (mapping file offsets of all non-first "mapped" files, locking all files when writing to the junctioned symbolic link, etc, etc).
If such a feature doesn't exist, are there are plans to implement it?
Asked by magnus
(449 rep)
Feb 23, 2016, 10:39 PM
Last activity: May 10, 2016, 07:01 PM
Last activity: May 10, 2016, 07:01 PM