"ls" doesn't work properly on ftp

"ls" doesn't work properly on ftp

Post by Alexis S. Zaharo » Sat, 08 Apr 2000 04:00:00



Hello All,
I've got such problem: when I run "ls" without arguments in "ftp" I got a
junk listing. "ls -lA" works perfectly.
What is more, when I write a simple program using "opendir...readdir" it
shows just the same junk listing, when compiling with "cc" from Solaris
package, and when I maked it with "gcc" everything became all right. And, of
course in terminal shell "ls" works perfectly. What can I do?
Here are some information:
----/etc/passwd line--------
guest:x:1007:10:test-don't delete:/export/home/alex/guest/:/bin/csh
----/etc/ftpaccess----------
class   all   real,guest,anonymous  *
limit   all   10   Any              /etc/msgs/msg.dead
readme  README*    login
readme  README*    cwd=*
message /welcome.msg            login
message .message                cwd=*
compress        yes             local remote
tar             yes             local remote
log commands real
log transfers anonymous,real inbound,outbound
shutdown /etc/shutmsg

-----THE PROBLEM---------------
Connected to localhost.
220 video FTP server (Version wu-2.4.2-academ[BETA-10](2) Tue Dec 7 8:37:44
MSK 1999) ready.
Name (localhost:alex): guest
331 Password required for guest.
Password:
230 User guest logged in.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.

.log
226 Transfer complete.
10 bytes received in 0.027 seconds (0.37 Kbytes/s)
ftp> ls -lA
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 1920
-rw-rw-r--   1 guest    guests    971537 Feb  2 15:31 pb.log
226 Transfer complete.
remote: -lA
74 bytes received in 0.051 seconds (1.43 Kbytes/s)

 
 
 

"ls" doesn't work properly on ftp

Post by Matt Atterbur » Sat, 08 Apr 2000 04:00:00


Alexis,

A *guess* is that your file name(s) have "funny" characters in them,
specifically some with the top bit set. CC might use a form of char
that retains the bit, while gcc might not. Similary, ftp might pass
the "funny" characters to your shell uncorrected, whereas ls might
strip out the funny bit [although I've never seen ls do this!].

Try `ls -a | cat -v' or even `echo * | cat -v' and see if cat -v
prints out any non-printing characters.

Other than this - weird!

m.


> Hello All,
> I've got such problem: when I run "ls" without arguments in "ftp" I got a
> junk listing. "ls -lA" works perfectly.
> What is more, when I write a simple program using "opendir...readdir" it
> shows just the same junk listing, when compiling with "cc" from Solaris
> package, and when I maked it with "gcc" everything became all right. And, of
> course in terminal shell "ls" works perfectly. What can I do?
> Here are some information:
> ----/etc/passwd line--------
> guest:x:1007:10:test-don't delete:/export/home/alex/guest/:/bin/csh
> ----/etc/ftpaccess----------
> class   all   real,guest,anonymous  *
> limit   all   10   Any              /etc/msgs/msg.dead
> readme  README*    login
> readme  README*    cwd=*
> message /welcome.msg            login
> message .message                cwd=*
> compress        yes             local remote
> tar             yes             local remote
> log commands real
> log transfers anonymous,real inbound,outbound
> shutdown /etc/shutmsg

> -----THE PROBLEM---------------
> Connected to localhost.
> 220 video FTP server (Version wu-2.4.2-academ[BETA-10](2) Tue Dec 7 8:37:44
> MSK 1999) ready.
> Name (localhost:alex): guest
> 331 Password required for guest.
> Password:
> 230 User guest logged in.
> ftp> ls
> 200 PORT command successful.
> 150 Opening ASCII mode data connection for file list.

> .log
> 226 Transfer complete.
> 10 bytes received in 0.027 seconds (0.37 Kbytes/s)
> ftp> ls -lA
> 200 PORT command successful.
> 150 Opening ASCII mode data connection for /bin/ls.
> total 1920
> -rw-rw-r--   1 guest    guests    971537 Feb  2 15:31 pb.log
> 226 Transfer complete.
> remote: -lA
> 74 bytes received in 0.051 seconds (1.43 Kbytes/s)

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


 
 
 

1. "ls" doesn't work properly on ftp

Hello Alll,
I've got such problem: when I run "ls" without arguments in "ftp" I got a
junk listing. "ls -lA" works perfectly.
What is more, when I write a simple program using "opendir...readdir" it
shows just the same junk listing, when compiling with "cc" from Solaris
package, and when I maked it with "gcc" everything became all right. And, of
course in terminal shell "ls" works perfectly. What can I do?
Here are some information:
----/etc/passwd line--------
guest:x:1007:10:test-don't delete:/export/home/alex/guest/:/bin/csh
----/etc/ftpaccess----------
class   all   real,guest,anonymous  *
limit   all   10   Any              /etc/msgs/msg.dead
readme  README*    login
readme  README*    cwd=*
message /welcome.msg            login
message .message                cwd=*
compress        yes             local remote
tar             yes             local remote
log commands real
log transfers anonymous,real inbound,outbound
shutdown /etc/shutmsg

-----THE PROBLEM---------------
Connected to localhost.
220 video FTP server (Version wu-2.4.2-academ[BETA-10](2) Tue Dec 7 8:37:44
MSK 1999) ready.
Name (localhost:alex): guest
331 Password required for guest.
Password:
230 User guest logged in.
ftp> ls
200 PORT command successful.
150 Opening ASCII mode data connection for file list.

.log
226 Transfer complete.
10 bytes received in 0.027 seconds (0.37 Kbytes/s)
ftp> ls -lA
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 1920
-rw-rw-r--   1 guest    guests    971537 Feb  2 15:31 pb.log
226 Transfer complete.
remote: -lA
74 bytes received in 0.051 seconds (1.43 Kbytes/s)

2. dialup and sendmail.

3. FTP works, but "ls" or "dir" doesn't ???

4. stty raw </dev/tty1fails to set raw mode

5. Why doesn't echo "text" 'command' "more text" work?

6. Dual Processors and Linux

7. Como fa?o funcionar gcc, g++, libc e libg no Doslinux

8. "Ping" doesn't work properly

9. "sqrt" doesn't seem to work properly.

10. nslookup "ls" command doesn't work

11. wu-ftpd "ls" doesn't work with anonymous?