Skip to content

Add function to OS interface to get a user's home directory

Describe the feature

Add function to return user's home directory so can support "~" and "~user" in pathnames mentioned in #266 (closed).

Is there a prototype?

No actual prototype is available, but we can unify the OS-dependent parts into C.

Describe the feature in more detail

While we can use unix-getpwnam to get the needed information, it seems a bit overkill to use that when what we really just want is the home directory. So it's probably best to add an OS function to do just that. Of course, this function will need to use getpwnam to get the info, but we don't need to expose the full generality of getpwnam for this. And @cshapiro says this makes a lot of sense since win32 has provided such a function for a long time.

Edited by Raymond Toy