Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!ziploc!eps From: eps@toaster.SFSU.EDU (Eric P. Scott) Newsgroups: comp.sys.next Subject: Re: BUG (?) in 'ftpd' for 'mget' handling ?? Summary: NeXT does it right and Sun does it wrong Message-ID: <1077@toaster.SFSU.EDU> Date: 26 Dec 90 05:56:44 GMT References: <1990Dec22.075502.2891@agate.berkeley.edu> Reply-To: eps@cs.SFSU.EDU (Eric P. Scott) Organization: San Francisco State University Lines: 53 In article <1990Dec22.075502.2891@agate.berkeley.edu> izumi@mindseye.berkeley.edu (Izumi Ohzawa) writes: >The problem is that "mget *" from a client seems to >return a file list which contains entries such as: > >subdir_name/filename >subdir_name/filename2 >I have tested this in 4.3BSD, and SunOS 4.0.3, 4.1. The >problem happens only for NeXT's ftpd. >Is this a known problem or a FEATURE? It's a feature(!), and not something NeXT introduced--you can blame the friendly folks on Your Own Campus, but before you complain, read on. LONG ANSWER: mget works by sending an FTP NLST command, and executing a RETR for each name in the returned list. In ->OLD<- versions of BSD ftpd, this forked /bin/ls to generate the listing. So if I had in my current directory the files a b/d c and I did ls * it would come back with a c b: d The BSD ftp client is "cleverly" hacked to stop reading when it gets to a blank line--this it what kept it from descending into subdirectories. Unfortunately, this depended on NLST being "broken"--at least as far as non-BSD clients were concerned. In post-4.3 ftpds, the "globbing" is done internally (so NLST * becomes effectively NLST a b c), then each file name is echoed, and each directory is listed out, giving a b/d c This behavior is consistent with the requirements of RFC 1123. SHORT ANSWER: Use mget . instead of mget * -=EPS=-