Subject: ls vs. dir (ls -l) speed

From: "Vu Q. Nguyen" <[email-masked]>
Date: Sat, 3 May 1997 09:54:38 -0700 (PDT)

hello,

When user ftp/anonymous logs into my wu-ftp server, the access times
for ls vs 'ls -a' are almost 100 times apart.

For instance, an ls command is returned in about .02 seconds while the
'ls -l' returns in 20 seconds.

I have the complete recommended library in ~ftp/usr/lib:

vu{root}47: ls -l
total 6046
-r-xr-xr-x   1 root     other      24576 Apr 30 17:19 ld.so*
-r-xr-xr-x   1 root     other     137160 Apr 30 17:19 ld.so.1*
-r-xr-xr-x   1 root     other     662764 Apr 30 17:19 libc.so*
-r-xr-xr-x   1 root     other     662764 Apr 30 17:19 libc.so.1*
-r-xr-xr-x   1 root     other      17480 Apr 30 17:14 libc_psr.so.1*
-r-xr-xr-x   1 root     other       2564 Apr 30 17:19 libdl.so*
-r-xr-xr-x   1 root     other       2564 Apr 30 17:19 libdl.so.1*
-r-xr-xr-x   1 root     other      15720 Apr 30 17:20 libintl.so*
-r-xr-xr-x   1 root     other      15720 Apr 30 17:20 libintl.so.1*
-rwxr-xr-x   1 root     other      15720 May  3 09:48 libmp.so*
-r-xr-xr-x   1 root     other      15720 Apr 30 17:16 libmp.so.1*
-r-xr-xr-x   1 root     other     566700 Apr 30 17:20 libnsl.so*
-r-xr-xr-x   1 root     other     566700 Apr 30 17:20 libnsl.so.1*
-r-xr-xr-x   1 root     other      68780 Apr 30 17:20 libsocket.so*
-r-xr-xr-x   1 root     other      68780 Apr 30 17:20 libsocket.so.1*
-r-xr-xr-x   1 root     other      39932 Apr 30 17:20 libw.so*
-r-xr-xr-x   1 root     other      39932 Apr 30 17:20 libw.so.1*
-r-xr-xr-x   1 root     other      10792 Apr 30 17:21 nss_dns.so.1*
-r-xr-xr-x   1 root     other      21144 Apr 30 17:21 nss_files.so.1*
-r-xr-xr-x   1 root     other      24404 Apr 30 17:20 nss_nis.so.1*
-r-xr-xr-x   1 root     other      28844 Apr 30 17:20 nss_nisplus.so.1*
-r-xr-xr-x   1 root     other       9312 Apr 30 17:21 straddr.so*
-r-xr-xr-x   1 root     other       9312 Apr 30 17:21 straddr.so.2*

Any ideas?
Again, any help is greatly appreciated.  And I'd like to thank everyone who
has helped me up to this point.
Thank you,
Vu

---

From: Alain Magloire <[email-masked]>
Date: Sat, 3 May 1997 18:56:21 -0400 (EDT)

Salut A Vous, O Grand Manitou Vu Q. Nguyen !!

> 'ls -l' returns in 20 seconds.
...
> Any ideas?

ls (LIST/NLST) without argument is builtin in wu-ftpd,
it will do the ftp_glob()/stat(). ls -l (NLST -l) will force
wu-ftpd to run an external program (ftp_popen("/bin/ls -lg"))
Hence the speed of the first.

ncftp takes avantage of the speed gain for file completion.
Everytime you type <TAB> to complete, ncftp sends NLST
get the list, parse and complete the file .. clever.

-- 
au revoir, alain
----
Aussi haut que l'on soit assis, on est toujours assis que sur son cul !!!