Skip to content

Fix #266: Support ~ in pathnames

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

Adds support for ~ in pathnames, like how the shell works.

Patch provided by Madhu based on code from sbcl.

#P"~user/" is recognized as the home directory for user "user" and #P"~/" is the home directory of the current user.

#P"~user/" has a directory component of (:absolute (:home "user")), which is allowed by the CLHS. For #p"~/", the directory component is (:absolute :home).

When operations are performed on such pathnames, the home directory is substituted appropriately. Thus (directory "~user/*.*") produces all the files in the user's home directory.

Edited by Raymond Toy

Merge request reports