home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc775 < prev    next >
Text File  |  1991-04-21  |  10KB  |  312 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.       RFC 775          Directory oriented FTP commands        Page 1
  7.  
  8.  
  9.  
  10.                DIRECTORY ORIENTED FTP COMMANDS
  11.  
  12.              David Mankins (dm@bbn-unix)
  13.              Dan Franklin (dan@bbn-unix)
  14.               A. D. Owen (ADOwen@bbnd)
  15.  
  16.  
  17.       As a part of the Remote Site Maintenance (RSM) project for  ARPA,
  18.       BBN  has installed and maintains the software of several DEC PDP-
  19.       11s running the Unix operating system.  Since Unix  has  a  tree-
  20.       like  directory  structure,  in  which directories are as easy to
  21.       manipulate as ordinary files, we  have  found  it  convenient  to
  22.       expand  the  FTP  servers  on  these machines to include commands
  23.       which deal with the creation of  directories.   Since  there  are
  24.       other  hosts  on  the  ARPA net which have tree-like directories,
  25.       including Tops-20 and  Multics,  we  have  tried  to  make  these
  26.       commands as general as possible.
  27.  
  28.       We have added four commands to our server:
  29.  
  30.  
  31.  
  32.        XMKD child
  33.              Make a directory with the name "child".
  34.  
  35.        XRMD child
  36.              Remove the directory with the name "child".
  37.  
  38.        XPWD
  39.              Print the current working directory.
  40.  
  41.        XCUP
  42.              Change to the parent of  the  current  working
  43.              directory.
  44.  
  45.  
  46.  
  47.       The  "child"  argument  should  be   created   (removed)   as   a
  48.       subdirectory of the current working directory, unless the "child"
  49.       string contains sufficient information to  specify  otherwise  to
  50.       the server, e.g., "child" is an absolute pathname (in Multics and
  51.       Unix), or child is something like "<abso.lute.path>" to Tops-20.
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.       RFC 775          Directory oriented FTP commands        Page 2
  66.  
  67.  
  68.  
  69.                  REPLY CODES
  70.  
  71.       The XCUP command is a special case of XCWD, and  is  included  to
  72.       simplify   the   implementation   of  programs  for  transferring
  73.       directory  trees  between  operating  systems  having   different
  74.       syntaxes for naming the parent directory.  Therefore we recommend
  75.       that the reply codes for XCUP be identical to the reply codes  of
  76.       XCWD.
  77.  
  78.       Similarly,  we  recommend  that  the  reply  codes  for  XRMD  be
  79.       identical to the reply codes for its file analogue, DELE.
  80.  
  81.       The reply codes for XMKD, however, are a bit more complicated.  A
  82.       freshly created directory will probably be the object of a future
  83.       XCWD command.  Unfortunately, the argument to XMKD may not always
  84.       be  a suitable argument for XCWD.  This is the case, for example,
  85.       when a  Tops-20  subdirectory  is  created  by  giving  just  the
  86.       subdirectory  name.   That  is,  with  a  Tops-20 server FTP, the
  87.       command sequence
  88.  
  89.                  XMKD MYDIR
  90.                  XCWD MYDIR
  91.  
  92.       will fail.  The new directory may only  be  referred  to  by  its
  93.       "absolute"  name;  e.g.,  if  the  XMKD command above were issued
  94.       while  connected  to   the   directory   <DFRANKLIN>,   the   new
  95.       subdirectory   could   only   be   referred   to   by   the  name
  96.       <DFRANKLIN.MYDIR>.
  97.  
  98.       Even on Unix and Multics, however, the argument given to XMKD may
  99.       not  be  suitable.   If  it  is a "relative" pathname (that is, a
  100.       pathname which is interpreted relative to the current directory),
  101.       the  user would need to be in the same current directory in order
  102.       to reach the subdirectory.  Depending on  the  application,  this
  103.       may be inconvenient.  It is not very robust in any case.
  104.  
  105.       To solve these problems, upon successful completion  of  an  XMKD
  106.       command, the server should return a line of the form:
  107.  
  108.            257<space>"<directory-name>"<space><commentary>
  109.  
  110.       That is, the server will tell the user what string  to  use  when
  111.       referring  to  the  created  directory.   The  directory name can
  112.       contain any character; embedded double-quotes should  be  escaped
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.       RFC 775          Directory oriented FTP commands        Page 3
  125.  
  126.  
  127.  
  128.       by double-quotes (the "quote-doubling" convention).
  129.  
  130.       For example, a  user  connects  to  the  directory  /usr/dm,  and
  131.       creates a subdirectory, named child:
  132.  
  133.           XCWD /usr/dm
  134.           200 directory changed to /usr/dm
  135.           XMKD child
  136.           257 "/usr/dm/child" directory created
  137.  
  138.       An example with an embedded double quote:
  139.  
  140.           XMKD foo"bar
  141.           257 "/usr/dm/foo""bar" directory created
  142.           XCWD /usr/dm/foo"bar
  143.           200 directory changed to /usr/dm/foo"bar
  144.  
  145.       We  feel that the prior existence of a subdirectory with the same
  146.       name  should be interpreted as an error, and have implemented our
  147.       server to give an "access denied" error reply in  that case.
  148.  
  149.           CWD /usr/dm
  150.           200 directory changed to /usr/dm
  151.           XMKD child
  152.           521-"/usr/dm/child" directory already exists;
  153.           521    taking no action.
  154.  
  155.       We recommend that failure replies for XMKD be  analogous  to  its
  156.       file  creating  cousin, STOR.  Also, we recommend that an "access
  157.       denied" return be given if a file name with the same name as  the
  158.       subdirectory  will conflict with the creation of the subdirectory
  159.       (this is a problem on Unix, but shouldn't be one on Tops-20).
  160.  
  161.       Essentially because the XPWD command returns  the  same  type  of
  162.       information  as  the successful XMKD command, we have implemented
  163.       the successful XPWD command to use the 257 reply code as well.
  164.  
  165.       We present here a summary of the proposed  reply  codes  for  the
  166.       experimental  commands.   The codes given outside parentheses are
  167.       consistent with RFC 691; i.e.,  are  for  the  old  protocol,  as
  168.       updated  by  the  suggestions  in  that RFC.  The server and user
  169.       programs at BBN-Unix currently implement these codes.  Reply  257
  170.       is  the  only new code.  Reply codes shown within parentheses are
  171.       for the "new" ftp protocol, most recently documented in RFC  765.
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.       RFC 775          Directory oriented FTP commands        Page 4
  184.  
  185.  
  186.  
  187.       The invented code for the RFC 765 Protocol is 251.
  188.  
  189.       Command:
  190.  
  191.           reply code      explanation
  192.  
  193.  
  194.       XMKD                    create directory
  195.  
  196.           257 (251) "pathname" created
  197.           521 (450) "pathname" already exists
  198.           506 (502) action not implemented
  199.           521 (450) access denied
  200.           550 (501) bad pathname syntax or ambiguous
  201.           425 (451) random file system error
  202.  
  203.       XCUP                    change directory to
  204.                       superior of current one
  205.  
  206.           200 (200) working directory changed
  207.           506 (502) action not implemented
  208.           507 (551) no superior directory
  209.           521 (450) access denied
  210.           425 (451) random file system error
  211.  
  212.       XRMD                    remove directory
  213.  
  214.           224 (250) deleted ok
  215.           506 (502) action not implemented
  216.           521 (450) access denied
  217.           550 (501) bad pathname syntax or ambiguous
  218.           425 (451) random file system error
  219.  
  220.       XPWD                    print current working
  221.                       directory
  222.  
  223.           257 (251) "pathname"
  224.           425 (451) random file system error
  225.           506 (502) action not implemented
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.       RFC 775          Directory oriented FTP commands        Page 5
  243.  
  244.  
  245.                  SUBTLETIES
  246.  
  247.       Because these  commands  will  be  most  useful  in  transferring
  248.       subtrees  from  one  machine  to another, we must stress the fact
  249.       that the argument to XMKD is to be interpreted as a sub-directory
  250.       of  the  current  working  directory,  unless  it contains enough
  251.       information for  the  destination  host  to  tell  otherwise.   A
  252.       hypothetical example of its use in the Tops-20 world:
  253.  
  254.           XCWD <some.where>
  255.           200 Working directory changed
  256.           XMKD overrainbow
  257.           257 "<some.where.overrainbow>" directory created
  258.           XCWD overrainbow
  259.           431 No such directory
  260.           XCWD <some.where.overrainbow>
  261.           200 Working directory changed
  262.  
  263.           XCWD <some.where>
  264.           200 Working directory changed to <some.where>
  265.           XMKD <unambiguous>
  266.           257 "<unambiguous>" directory created
  267.           XCWD <unambiguous>
  268.  
  269.       Note that the first example results  in  a  subdirectory  of  the
  270.       connected  directory.   In  contrast,  the argument in the second
  271.       example contains enough information for Tops-20 to tell that  the
  272.       <unambiguous> directory is a top-level directory.  Note also that
  273.       in  the  first  example  the  user  "violated"  the  protocol  by
  274.       attempting  to  access  the freshly created directory with a name
  275.       other than the one returned  by  Tops-20.   Problems  could  have
  276.       resulted  in this case had there been an <overrainbow> directory;
  277.       this is an ambiguity inherent in  some  Tops-20  implementations.
  278.       Similar  considerations  apply to the XRMD command.  The point is
  279.       this: except where to do so would violate  a  host's  conventions
  280.       for  denoting relative versus absolute pathnames, the host should
  281.       treat  the  operands  of  the   XMKD   and   XRMD   commands   as
  282.       subdirectories.   The  257  reply to the XMKD command must always
  283.       contain the absolute pathname of the created directory.
  284.  
  285.  
  286.  
  287.                  References
  288.  
  289.       File Transfer Protocol (RFC 765), Postel,  J., June 1980
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.       RFC 775          Directory oriented FTP commands        Page 6
  301.  
  302.  
  303.  
  304.       CWD Command of FTP (RFC 697), Lieb, J., NIC 32963, 14 July 1975
  305.       One More Try on the FTP (RFC 691), Harvey, B., NIC 32700, 28  May
  306.       1975
  307.       Revised FTP Reply Codes (RFC 640),  Postel,  J.,  N.  Neigus,  K.
  308.       Pogran, NIC 30843, 5 June 1974
  309.       File Transfer Protocol (RFC 542), Neigus, N., NIC 17759,  12 July
  310.       1977
  311.  
  312.