get the file directory

Conor P. Cahill cpcahil at virtech.uucp
Thu Nov 16 01:28:07 AEST 1989


In article <1724 at unccvax.UUCP>, cs00wsc at unccvax.UUCP (Shiang Chin) writes:
> I am trying to the file list of a file directory on
> Sun station running Unix. Can someone read the following
> C code for me; I don't know what's wrong on my code.
> 
  [ example of reading fixed length directory entries deleted ]

> If anyone knows the problem, please tell me how to solve this.
> Thanks a lot.

The problem is that Sun uses a BSD style directory that does not have
fixed length directory entries.  You should use the opendir(), readdir(), etc
library calls to process the directory entries.

Doug gwyn posted a portable version of these directory utilities (that 
work for both system V and BSD file systems) to comp.sources.unix (I think). 

You can either use the standard BSD functions that are included in the sun libc
or you can download the portable versions.

-- 
+-----------------------------------------------------------------------+
| Conor P. Cahill     uunet!virtech!cpcahil      	703-430-9247	!
| Virtual Technologies Inc.,    P. O. Box 876,   Sterling, VA 22170     |
+-----------------------------------------------------------------------+



More information about the Comp.lang.c mailing list