views:

521

answers:

2

I have a feeling that I already know the answer to this one, but I thought I'd check.

I have a number of different folders:

images_a/
images_b/
images_c/

Can I create some sort of symlink such that this new directory has the contents of all those directories? That is this new "images_all" would contain all the files in images_a, images_b and images_c?

+5  A: 

No. You would have to symbolically link all the individual files.

What you could do is to create a job to run periodically which basically removed all of the existing symbolic links in images_all, then re-create the links for all files from the three other directories, but it's a bit of a kludge, something like this:

rm -f images_all/*
for i in images_[abc]/* ; do; ln -s $i images_all/$(basename $i) ; done

Note that, while this job is running, it may appear to other processes that the files have temporarily disappeared.

You will also need to watch out for the case where a single file name exists in two or more of the directories.

paxdiablo
You can use `lndir` to do the symlinking.
Noufal Ibrahim
+1  A: 

You could try a unioning file system like unionfs!

http://www.filesystems.org/project-unionfs.html

http://aufs.sourceforge.net/

Ash Kim
And the phrase "is still in development stage" strikes fear into the hearts of even the bravest soul :-).
paxdiablo
that looks pretty cool, but yeah, a tad scary.
nickf