I'm not convinced the canonical path is really the correct path to construct with. Its going to resolve symlinks, which on some systems may wind up with a nasty "internal" path pointing to the NFS server that contains your home directory, rather than say your home directory.