[cs631apue] Question about ~ translation 2

Jan Schaumann jschauma at stevens.edu
Sat Nov 22 15:50:06 EST 2014


zding4 <zding4 at stevens.edu> wrote:

> There must be a user name followed by `~` like
>  `server/~username/somefile`
> Can `~` exist without the user name? like:
>  `server/~/somefile`

Neither of these would yield expansion of '~' and both would be literal
pathnames.  (They'd both also be invalid, since they're missing a
leading '/'.)

A few examples:

URI		absolute path
---------------------------------------------
/               <docroot>/.
/foo            <docroot>/foo
/~foo           <foo's home directory>/
/~foo/foo/f     <foo's home directory>/foo/f
/foo/~foo/f     <docroot>/foo/~foo/f
~foo            400 Bad Request
/cgi-bin/foo    <cgidir>/foo

I hope this helps.

-Jan


More information about the cs631apue mailing list