From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 5 Dec 1997 10:57:52 +0900 From: arisawa@vega.aichi-u.ac.jp arisawa@vega.aichi-u.ac.jp Subject: [9fans] A patch for ftp Topicbox-Message-UUID: 6c3cbb02-eac8-11e9-9e20-41e7f4b1d025 Message-ID: <19971205015752.XNHQ-hyrAv3XXLUmQAGF6fq28h_cbJyXt5SsQIeI6N0@z> Hello 9fans This is a patch to /sys/src/cmd/service/ftp.c The patch includes: 1. bug fix to: tcp!port messgae This problem is already spoken elsewhere. 2. bug fix to: ls -l I announced previously. 3. support size command New patch 4. put "/" after directory names New patch Change the source to work it: term% diff ftp.c.orig ftp.c 62a63 > int sizecmd(char*); 102a104 > { "size", sizecmd, }, 673c675 < sprint(buf, "tcp!%d", port); --- > sprint(buf, "tcp!*!%d", port); 753c755,756 < n += sprint(buf+n, "%s", name); --- > if(d->mode & CHDIR) n += sprint(buf+n, "%s/", name); > else n += sprint(buf+n, "%s", name); 898,899c901,902 < if(Cflag) < lflag = 0; --- > if(lflag) > Cflag = 0; 1532a1536,1545 > } > > int > sizecmd(char *file) > { Dir edir; > if(stat(file,(char*)&edir)) > return reply("550 %s: No such file or directory.",file); > if(edir.mode & CHDIR) /* directory */ > return reply("550 %s: not a plain file.",file); > return reply("213 %lld",edir.vlength); You can get this boddle from: ftp://plan9.aichi-u.ac.jp/netlib/patchs/ftp.bod Kenji Arisawa E-mail: arisawa@aichi-u.ac.jp