Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!BBN.COM!ado From: ado@BBN.COM (Buz Owen) Newsgroups: comp.protocols.tcp-ip Subject: Re: RFC for MPUT and MGET in FTP . . . Message-ID: <8910110612.AA23198@ucbvax.Berkeley.EDU> Date: 11 Oct 89 00:22:06 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 47 MGET and MPUT aren't explicitly specified in the FTP protocol spec (RFC 959) because these commands a matter "local" to the user ftp program -- only the language used between the FTP server program and the FTP user program is standardized by the protocol spec. Here are some hints though: For MPUT, the user FTP program should accept an argument which designates a group of local files to be sent -- a directory or subdirectlry name or file group specifier, expressed according to the host's local convention, and execute "STOR" commands for each of the files indicated. If the local system contained system calls or subroutines for interpreting file group specifiers, these facilities should be used to give standard local semantics to the argument. For MGET, the user program should accept a string argument (with no local interpretation), submit an NLST command with this string as its argument to the server to obtain a list of files on the server which match the argument, and then execute one RETR command for each filename in the list received from the server, retrieving each of the files in turn. A point to watch out for here is that (a naive implementation of) the FTP server might only respond to NLST with whole directory or subdirectory listings -- i.e. fail to implement its own local group name convention, or the server's operating system might not have a file group naming convention. In any case, it is the user's responsibility to know the remote syntax for designating a group of files, not the ftp user program's responsibility. MGET and MPUT will work better if the user FTP program is prepared to create local directories implicitly when doing MGET, and to execute MKD, CWD and CDUP commands when doing MPUT to transfer a file hierarchy, since there is no guarantee that a server will create necessary (sub) directories when given a filename containing directory components in a STOR command. When transferring to or from a system with differing filename syntax, the user FTP program might also (attempt to) give help in adjusting or translating filenames, although this can't be done in a fully general way. The original implementation of MGET and MPUT at BBN contained heuristics to translate between unix file name syntax and Tenex/TOPS20 or Multics file name syntax. This involved optional stripping of trailing version numbers, case translation, delimiter translations, (e.g. ">" to "/" for Multics), and removal of the directory component, under control of various flags. The discussion in RFC 959 under the NLST, MKD, PWD, and CDUP commands may be of some help here. The advice in in RFC 1123 under the same topics and also under "user interface" is also relevant. With apologies for possibly belaboring the obvious, hope this helps. Buz