The name prefix is initially a server-defined function of the username. It may be changed by CWD and CDUP requests.
The name prefix allows the client to abbreviate encoded pathnames in parameters for various requests.
The server may accept a CWD request using code 200 or 250:
CWD /public 250 Okay.(RFC 959 says that code 250 is required, but also gives examples of code 200. I recommend 250.)
The server may reject a CWD request using code 550:
CWD /pubilc 550 /pubilc: No such file or directory.Most servers reject CWD requests unless the pathname refers to an accessible directory. Some servers accept all CWD requests, without regard for what directories are actually accessible.
RFC 1123 requires that the server treat XCWD as a synonym for CWD.
PWD 257 "/home/joe"
If the server accepts the PWD request (required code 257), its response consists of exactly one line, with text in the following format:
Servers are permitted to reject PWD requests with code 550, but high-quality servers will try to accept all PWD requests.
RFC 1123 requires that the server treat XPWD as a synonym for PWD.
The server may accept a CDUP request using code 200 or 250. (RFC 959 says that code 200 is required; but it also says that CDUP uses the same codes as CWD.) The server may reject a CDUP request using code 550.
RFC 959 envisioned CDUP as a means of undoing a previous CWD, to simplify namespace navigation:
PWD 257 "/home/joe" CWD tex 250 Okay. PWD 257 "/home/joe/tex" CDUP 200 Okay. PWD 257 "/home/joe"However, this is horribly unreliable in practice. Here is a typical example from a UNIX server where there is a ``symbolic link'' from /bin to /usr/bin:
PWD 257 "/" is current directory. CWD /bin 250 CWD command successful. PWD 257 "/usr/bin" is current directory. CDUP 250 CWD command successful. PWD 257 "/usr" is current directory.I strongly recommend that clients avoid CDUP.
RFC 1123 requires that the server treat XCUP as a synonym for CDUP.