1875 of 62457 members online
Coffee Machines 720 GetFrank GymJunkie Menu Mania Snow Surf Varsity

Forgot Your Password? Create Account
[quote]
I have a web server running linux to serve my website, and i'm trying to create a "work safe" theme, so people can use the site at work and have it look inconspicuous. Basically this means I take what I already have, add a couple of files, change another couple, and the rest (maybe 50 files) are identical. I don’t want to have duplicate files if I can help it.

Does anyone know a way to have a linux system look in a directory for a file, and if it’s not there look in another directory? I know I could use symbolic links, but that’d mean I have to create a link for every single file. I can’t just point the whole directory, because I want a few files that are different.

Maybe a little diagram would help, because I don’t know if I’ve explained this well.

Dir one
File1.txt
File2.txt
File3.txt
File4.txt

Dir two
File1.txt (unchanged)
File2.txt (modified)
File3.txt (unchanged)
File5.txt (new)

Files 1 and 3 in dir two are identical, and so should point to the files in dir one. File 2 is different, and file 5 is new.

Any ideas?
[quote]
How about a third directory that contains common files that are the same and symbolic link to the entire contents of that directory from the other two?
[quote]
Dir one
File2.txt
File4.txt
+symbolic links to all file in Dir three

Dir two
File2.txt (modified)
File5.txt (new)
+symbolic links to all file in Dir three

Dir three
File1.txt
File3.txt
[quote]
Is there any way to create a symbolic link that means "if the file isn't in this directory, look in this directory" ??? I really don't want to have to make and maintain loads of symbolic links.
[quote]
You could write a script to maintain/setup the symbollic links that has the logic you want in it.
[quote]
I guess that's possible, but i'm really looking for a more elegant solution. Plus it'd be nice if it works on my windows box too.
[quote]
I would personally regard taking all the common files and grouping them into a third directory as being more elegant. But I guess not everyone works the same way,
[quote]
harvey said:
I would personally regard taking all the common files and grouping them into a third directory as being more elegant. But I guess not everyone works the same way,


I consider that quite elegant, the inelegant part would be all the symbolic links.