Path: utzoo!attcan!uunet!husc6!mailrus!rutgers!ucsd!ucsdhub!jack!elgar!ford From: ford@elgar.UUCP (Mike "Ford" Ditto) Newsgroups: comp.unix.xenix Subject: Re: xbbs features as request Summary: struct direCt is the dumb idea Message-ID: <174@elgar.UUCP> Date: 6 Jun 88 05:12:38 GMT References: <203@turnkey.TCC.COM> <3837@uwspan.UUCP> <7841@ncoast.UUCP> Reply-To: ford@kenobi.UUCP (Mike "Ford" Ditto) Organization: Omnicron Data Systems, Bonita, CA Lines: 46 In article <7841@ncoast.UUCP> allbery@ncoast.UUCP (Brandon S. Allbery) writes: > Can you say "portable"? BSD has portable directory routines. An utterly ridiculous statement. > I hate to say this, AT&T: but "struct direNt" was a DUMB idea. > Incompatibility still reigns supreme. AAAAARGH!!!!! What would you suggest, that they return (struct direct)s so that BSD code will compile but not work? Do like BSD does and prohibit programs from using (struct dirent) and (struct dirent) in the same source file by giving them the same name? What they did instead was make a system that, unlike BSD's directory(3C) library, is *portable*. 1) it separates "portable" directory reading from BSD-style implementation-dependent direct filesystem access. 2) it works on various filesystem types, even on the same system. 3) it can be used on SysV or BSD, unlike BSD's equivalent. 4) it can be made compatible with typical BSD code that believes it is reading (struct direct)s from the directory by simply doing #define direct dirent. 5) it takes a few keystrokes to convert a BSD program to use the better (struct dirent) interface. A few more keystrokes will make it also compatible with the old BSD directory routines. The original BSD routines were never meant to be "portable", otherwise they wouldn't have returned pointers to internal filesystem data types and required user programs to know the format of these data. But you know you'd get flamed for a statement like that, didn't you? :-) :-) :-) :-) :-) :-) :-) :-) :-) -=] Ford [=- "Once there were parking lots, (In Real Life: Mike Ditto) now it's a peaceful oasis. ford%kenobi@crash.CTS.COM This was a Pizza Hut, ...!sdcsvax!crash!kenobi!ford now it's all covered with daisies." -- Talking Heads