Skip to content

Fix #266: Support ~user in namestrings

Raymond Toy requested to merge issue-266-b-tilde-pathname-support into master

Support ~ in pathnames. "~user/" is replaced by the home directory of the user "user". Likewise "~/" is replaced by the home directory of the current user. This is analogous to how the shell works. If the specified user does not exist, throw an error.

First, modify system:get-user-homedir-pathname to return a namestring instead of a pathname. The current (and only) use is to use the namestring, so let's not cons a pathname just to get the namestring.

Second, modify parse-unix-namestring to look for a leading "~". If it's found replace it with the user's home directory. This is done via replace-tilde-user to do the replacement and user-homedir-namestring to get the user's home directory.

Edited by Raymond Toy

Merge request reports