On Mon, Mar 26, 2001 at 08:23:58PM -0600, Steve Siegfried wrote:
> Peter Clark wrote:
> >    So, to recap: is there something that will redirect calls? For
> > instance, say program foo wants to open up ~/.bar. The call is
> > intercepted and the call changed to ~/dotfiles/.bar. Sort of like
> > symbolic links without the actual link. Is this possible? Can some
> > program run in the background and handle this? That's all I want to 
> > know.
> 
> Yes, by using symbolic and/or hard links.  Read up on "ln" versus
> "ln -s" (ln (1)) and, if you program, on fstat(2), lstat(2), link(2)
> and unlink(2).

Well, that wouldn't really help with what he's looking for because
the linked file would still be a dotfile in his home directory. So,
yes he would be able to put link copies (symbolic or hard) of
dotfiles in one directory, but he would still have versions in
his home directory (which he doesn't want).

Anyway, I don't see a good answer to Peter's question, but I have 
some ideas (listed in order of decreasing usefullness).

0. Periodically delete dotfiles of programs you don't use
often or anymore.  If you haven't customized the settings,
it won't hurt the program to remake its dotfile if you
ever happen to run it again.

1. Submit wishlist bugs against programs that won't hide
dotfiles in their file listings. Or better yet submit patches
to fix the problem.

2. Give up on your home directory. Just leave dotfiles and
any directories that are needed by your programs in home. Move
all of your other directories and files somewhere else -
say /home/foo/home.  Then set things up so that your automatic
starting directory is /home/foo/home.

3. Write the program your talking about that intercepts the calls
to dotfiles.  My naive guess is that this would be a huge pain.
I think from your description that you might have to write
a kernel module since you would be playing with low-level file
system stuff.  Anyway, it sounds painful.

Anyway, this probably isn't much help, but there it is anyway.

-- 
Jim Crumley                  |
crumley at fields.space.umn.edu |
Work: 612 624-6804 or -0378  |