home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2696 < prev    next >
Encoding:
Internet Message Format  |  1991-02-08  |  2.5 KB

  1. From: chris@attron.ruhr.sub.org (Christian Schlichtherle)
  2. Newsgroups: alt.sources
  3. Subject: list V1.2.1.1 - Prints documented listings (official patch #02)
  4. Message-ID: <530@attron.ruhr.sub.org>
  5. Date: 7 Feb 91 20:47:06 GMT
  6.  
  7. This is an official patch for list(C) V1.2.1.1.
  8. I have received some mails from Sun's and ULTRIX running machines.
  9. It seems that they lack a DIRSIZ definition. This defines the length
  10. of a file name entry in a directory. For USG systems, this is 14
  11. characters. I knew that BSD can handle much longer filenames, but I
  12. didn't know that they lack a DIRSIZ definition. On USG systems, DIRSIZ
  13. is used to define the "direct" structure. I need this structure to read
  14. the directory.
  15. On my system, "direct" is defined as follows:
  16.  
  17. struct    direct
  18. {
  19.     ino_t    d_ino;
  20.     char    d_name[DIRSIZ];
  21. };
  22.  
  23. NOTE ON:
  24. You can set DIRSIZ to any value large enough to hold a filename!!!
  25. The definition does not affect the definition for "struct direct",
  26. as it is made after the definition of "direct"!!!
  27. DIRSIZ is only used as a buffer size, so the size does not even affect
  28. performance (the buffer is held in static data)!
  29. NOTE OFF:
  30.  
  31. So, setting DIRSIZ to 255 will do the job unless you have filenames
  32. longer than 255 characters!
  33. The only thing that could scare me is that BSD might not have a
  34. structure called "direct"... :-) If this is true, please tell me how
  35. I can read a directory the low level way (not using readdir(), etc.)
  36. on BSD like systems!
  37.  
  38. For now, this is the patch that should remedy the situation unless
  39. BSD has completely different directory formats:
  40. ------------ cut here ------------
  41. 19c
  42. /*
  43.  * Things you normally won't change.
  44.  */
  45.  
  46. #ifndef    DIRSIZ        /* This is for BSD likes (SUN, ULTRIX, etc.) */
  47. #    define    DIRSIZ    255
  48. #endif
  49.  
  50. .
  51. 17c
  52. /* #define ALLBUTDOT    /* "All but dot" is default for root? */
  53. .
  54. 2c
  55.  * @(#) config.h  1.2.1.1    91/02/07 
  56. .
  57. w
  58. ------------ cut here ------------
  59. Sorry, no context diff...
  60.  
  61. The patch also undefines ALLBUTDOT (see config.h) as I realized
  62. that it is not that much useful.
  63.  
  64. Save this patch to the file "diff" and apply it to the file
  65. "config.h" using either
  66.  
  67. ed config.h < diff
  68.  
  69. or
  70.  
  71. patch config.h diff
  72.  
  73. # Sorry, I was wrong in the posting of the last patch. It should read
  74. # "patch list.c diff" instead of "patch < diff".
  75. # I have not tested this, anyway... :-)
  76.  
  77. Sorry for the wasted bandwith,
  78.     Chris
  79. -- 
  80. Snail: Christian Schlichtherle, Elbscheweg 20, 5802 Wetter 4, Germany
  81. Email: chris@attron.ruhr.sub.org    Tel.: +49 2335 7550
  82. "Der Tod ist ein Meister aus Deutschland" -- Paul Celan
  83.