list V1.2.1.1 - Prints documented listings (official patch #02)

Christian Schlichtherle chris at attron.ruhr.sub.org
Fri Feb 8 07:47:06 AEST 1991


This is an official patch for list(C) V1.2.1.1.
I have received some mails from Sun's and ULTRIX running machines.
It seems that they lack a DIRSIZ definition. This defines the length
of a file name entry in a directory. For USG systems, this is 14
characters. I knew that BSD can handle much longer filenames, but I
didn't know that they lack a DIRSIZ definition. On USG systems, DIRSIZ
is used to define the "direct" structure. I need this structure to read
the directory.
On my system, "direct" is defined as follows:

struct	direct
{
	ino_t	d_ino;
	char	d_name[DIRSIZ];
};

NOTE ON:
You can set DIRSIZ to any value large enough to hold a filename!!!
The definition does not affect the definition for "struct direct",
as it is made after the definition of "direct"!!!
DIRSIZ is only used as a buffer size, so the size does not even affect
performance (the buffer is held in static data)!
NOTE OFF:

So, setting DIRSIZ to 255 will do the job unless you have filenames
longer than 255 characters!
The only thing that could scare me is that BSD might not have a
structure called "direct"... :-) If this is true, please tell me how
I can read a directory the low level way (not using readdir(), etc.)
on BSD like systems!

For now, this is the patch that should remedy the situation unless
BSD has completely different directory formats:
------------ cut here ------------
19c
/*
 * Things you normally won't change.
 */

#ifndef	DIRSIZ		/* This is for BSD likes (SUN, ULTRIX, etc.) */
#	define	DIRSIZ	255
#endif

.
17c
/* #define ALLBUTDOT	/* "All but dot" is default for root? */
.
2c
 * @(#) config.h  1.2.1.1	91/02/07 
.
w
------------ cut here ------------
Sorry, no context diff...

The patch also undefines ALLBUTDOT (see config.h) as I realized
that it is not that much useful.

Save this patch to the file "diff" and apply it to the file
"config.h" using either

ed config.h < diff

or

patch config.h diff

# Sorry, I was wrong in the posting of the last patch. It should read
# "patch list.c diff" instead of "patch < diff".
# I have not tested this, anyway... :-)

Sorry for the wasted bandwith,
	Chris
-- 
Snail: Christian Schlichtherle, Elbscheweg 20, 5802 Wetter 4, Germany
Email: chris at attron.ruhr.sub.org	Tel.: +49 2335 7550
"Der Tod ist ein Meister aus Deutschland" -- Paul Celan



More information about the Alt.sources mailing list