From: Sean Middleditch Date: 2001-11-25T09:07:35+09:00 Subject: [ruby-talk:26384] Re: Converting ~fred to home directory path On Sat, 2001-11-24 at 18:19, HarryO wrote: > Does ruby provide a way to convert things like ~fred into the appropriate > full path name to the user's home directory under UNIX? > > If not, I guess the right way to do it is to simply read the /etc/passwd > file? Does ruby have a class that allows playing with the contents of > the password file cleanly? No no. ~,^ Read the $HOME environment variable. /etc/passwd might not even have the user in it (login over NIS or LDAP). $HOME is supposed to be set by the login shell, so use that. > > Perhaps this could be added to the globbing that Dir::[] does?