I think I understand what soft and hard symbolic links are, but I'm not sure how programs access them (as opposed to me, a user).
For example, I want to replace my ~/.bashrc with a symbolic link that resides elsewhere. When I as a user open this file, say in Vim, really I'm editing ~/some/path/.bashrc (regardless the type of link). That's good and all, but what about programs? For example an installer that appends to ~/.bashrc?
Can programs open a file in either "mode"—following a symlink or not? My guess is that file handles in programming languages compile or interpret such that they refer to an inode, so with hardlinks at least, they always follow.
If softlinks can be opened in either mode, what does that look like in a major programming language?
If programs are "blind" to symbolic links, then is it safe to assume I can softlink ~/.bashrc to ~/some/path/.bashrc and expect it to work with no hitches ever, provided that the file exists and retains the same permissions as the original ~/.bashrc? Or is there some weird scenario that can break its function?
I have read
- How to efficiently track .bashrc (and similar) with git? (No answer.)
- Are there pitfalls to putting $HOME in git instead of symlinking dotfiles? (I don't want this setup.)
and other answers that explain the difference between a soft and hardlink, but more knowledge about symbolic links doesn't make me feel confident in this regard.