Path: utzoo!attcan!uunet!husc6!mailrus!ames!pacbell!att!occrsh!uokmax!sam From: sam@uokmax.UUCP (Sam L Falkner) Newsgroups: comp.unix.wizards Subject: Re: scandir() Summary: Exactly... Keywords: scandir catch-22 Message-ID: <1455@uokmax.UUCP> Date: 2 Jul 88 03:18:00 GMT References: <1445@uokmax.UUCP> <799@scubed.UUCP> <12267@mimsy.UUCP> <801@scubed.UUCP> Organization: University of Oklahoma, Norman, OK Lines: 18 In article <801@scubed.UUCP>, warner@scubed.UUCP (Ken Warner) writes: > In article <12267@mimsy.UUCP> chris@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