scandir()

Sam L Falkner sam at uokmax.UUCP
Sat Jul 2 13:18:00 AEST 1988


In article <801 at scubed.UUCP>, warner at scubed.UUCP (Ken Warner) writes:
> In article <12267 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
> >	struct direct **list;
> >	n = scandir("foo", &list, (int (*)())NULL, (int (*)())NULL);
> > * The manual is misleading; namelist is neither an array nor a pointer to
>         ^^^^^^^^^^^^^^^^^^^^
> The only way I could make this declaration work was to declare a static array.
> And now I don't know why it worked at all.  Must have been tired or stupid. 

   Thanks to everyone who responded.  I also found the manual rather
confusing, but I got the program working the same way you did.  The
trouble was that as I started adding to the program, I began to get
segmentation faults, and realized what the problem was.  Then I
couldn't figure out what the correct declaration was (I also tried
using "struct direct *namelist[]" and calling it by "&namelist" to no
avail.  Oh well...)
   Again, thanks for all the help.
	- Sam Falkner, University of Oklahoma



More information about the Comp.unix.wizards mailing list