|
This is why relative paths have problems sometimes. There isn't a good way to handle absolutely any relative path, because all relative paths have an assumption:
the current working directory is "x".
You are assuming /home/polypus. Unix tools are designed to do one thing very well. It's hard to make a bulletproof tool because of the cwd assumption.
Because:
Obviously it may not be true.
So, there is no really elegant way to deal with it. You're onto one way to deal with it.
For programming, you should consider avoiding relative paths unless you want the code to work if and only if it runs from a certain directory.
|