Subject: ls Problem

From: Maged Taher <[email-masked]>
Date: Thu, 27 Feb 1997 18:15:42 -0800

Hi Everybody,

I installed wu_ftp on a Solaris 2.5 platform. and Everything is working
fine except the 'ls' command (it displays part of the filenames and some
weird data) and what is really confusing me is that 'ls -l' is working fine!!

When I removed the 'ls' file from ~ftp/bin/ directory the 'ls -l' stopped
working but the 'ls' kept on giving the weird data.

Why did the 'ls' kept on displaying the weird data why did not it stop
displaying anything as the 'ls -l'?
PS: 
This case is applicable on real and anonymous users.

Thanks in Advance for your help.

- Maged

---

From: George Ross <[email-masked]>
Date: Fri, 28 Feb 1997 10:49:35 +0000

> weird data) ...

Perhaps it's this (from an oldish version of the Solaris FAQ):

6.19) Why doesn't readdir work?  It chops the first two characters of
    all filenames.
 
    You're probably linking with libucb and didn't read question
    6.18.  (Readdir in libucb.so wants you to include sys/dir.h,
    but many SunOS 4.1.x programs included <dirent.h>, consequently,
    you're mixing native <dirent.h> struct dirent with libucb
    readdir().  The symptom of this mixup is that the first two
    characters of each filename are missing.  Make sure you use the
    native compiler (default /opt/SUNWspro/bin/cc, which may not be in
    your PATH), and not /usr/ucb/cc.

(And before anyone asks, here's 6.18:

6.18) Can I use the source compatibility package to postpone porting?
 
    Not really.  The Source code compatibility package is
    compatible with BSD 4.2, not SunOS 4.1.x.  The consensus
    is that the library is broken beyond usability.
    If you use libucb to pick up some functions you need, it
    is often best to specify it *after* all other libraries and
    after libc with:
 
            -lc -L/usr/ucblib -R/usr/ucblib -lucb
 
    or preferably:
 
            -lc /usr/ucblib/libucb.a
)

"ls" is built-in.  "ls -l" aka "dir" runs bin/ls.
-- 
Dr George D M Ross, Department of Computer Science, University of Edinburgh
       Kings Buildings, Mayfield Road, Edinburgh, Scotland, EH9 3JZ
Mail: [email-masked]   Voice: +44 131 650 5147   Fax: +44 131 667 7209
   PGP: 1024/B74A4F7D  14 E8 B3 00 20 04 68 F8  95 40 CB 36 A4 D4 FA 90