home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.12 / text0004.txt < prev    next >
Encoding:
Internet Message Format  |  1989-01-07  |  2.8 KB

  1. Cc: gwyn@brl.arpa, utzoo.UUCP!henry@cgl.ucsf.edu
  2. From: gnu@hoptoad.UUCP (John Gilmore)
  3.  
  4. I just ran across the first use of the Posix directory access library
  5. and was disappointed that it is not source-code compatible with the
  6. Unix BSD library, or with the public domain directory access library
  7. that has been widely used on non-BSD systems.
  8.  
  9. For some reason the ***&%^$ standard changed the names of the include
  10. file and the struct!
  11.  
  12. The old #include <sys/dir.h>    is now    #include <dirent.h>
  13.   "    struct direct            struct dirent
  14.  
  15. My problem arose when Richard Todd ported my PD tar to Minix.  This
  16. tar program has been ported and run on many, many Unix variants.  All
  17. these versions compile from the same sources.  Minix lacks a directory
  18. access library (and a lot of other library routines), so Richard used
  19. the package posted to mod.sources by Doug Gwyn.  Unfortunately, it's
  20. not compatible with Unix, and I wouldn't change tar; I'd rather have it
  21. break on Richard's modified Minix than break on every Unix in existence.
  22. So his Minix tar sources must remain slightly different from the master,
  23. portable sources I keep.
  24.  
  25. Somehow when you read these standards on paper, they don't mean much.
  26. When people implement it and your 'proven portable' programs break, the
  27. little meddling changes get a lot more important.
  28.  
  29. >From the NOTES file in Doug's package:
  30. >One annoying compatibility problem has arisen along the way, namely that the
  31. >original Berkeley interface used the same name, struct direct, for the new data
  32. >structure as had been used for the original UNIX filesystem directory record
  33. >structure.  This name was changed by the IEEE 1003.1 (POSIX) Working Group to
  34. >"struct dirent" and was picked up for SVR3 under the new name; it is also the
  35. >name used in this portable package.  I believe it is necessary to bite the
  36. >bullet and adopt the new non-conflicting name.  Code using a 4.2BSD-compatible
  37. >package needs to be slightly revised to work with this new package...
  38.  
  39. Why POSIX changed it I'll probably never know, but it's clear why SVR3
  40. adopted the change.  They have been resisting incorporating the
  41. directory library for years and years, apparently because it was a good
  42. idea.  When POSIX mangled it, AT&T jumped at the chance to adopt a
  43. version incompatible with all the code written for BSD Unix.  So call
  44. me a cynic.
  45.  
  46. No portable application program should be including a struct defining
  47. the internal format of old Unix file system entries, so I can't see any
  48. theoretical problem created by using the name "struct direct" for the
  49. result of Posix readdir().  There is certainly no practical problem
  50. with it either, since we have been doing it for the last 5 years.
  51.  
  52. I'm curious why Doug thinks "it is necessary to bite the bullet".  How about
  53. the obvious alternative of changing the standard to match all existing
  54. applications?
  55.  
  56. Volume-Number: Volume 12, Number 5
  57.  
  58.