[comp.sys.amiga] whereis utility

hsgj@batcomputer.tn.cornell.edu (Dan Green) (09/29/87)

A while ago I promised that I'd post a "whereis" utility to
comp.sources.amiga.  I posted it on Sept 7, 1987.  Today is Sept 28
and it still hasn't shown up yet.  Rather then trying again, I
am simply going to send this to comp.sys.amiga.  Hopefully this
does not anger too many people.  Please note that this whereis uses
different option flags then the unix whereis, because I've noticed
that few amiga programs use the rwx bits, so there is no point in
checking them.

-- Dan Green

# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by tcgould.tn.cornell.edu!hsgj on Mon Sep 28 20:24:02 EDT 1987
# Contents:  whereis.doc whereis.uue whereis.c
 
echo x - whereis.doc
sed 's/^@//' > "whereis.doc" <<'@//E*O*F whereis.doc//'
NAME:
	Whereis
	Copyright 1987 Daniel Green.  Freely Redistributable
	No warranty expressed or implied.  Use at your own risk.

SYNOPSIS:
	Prints the directory where a given filename resides

SYNTAX:
	Whereis [-a] [-v] [-d device] filename
	Whereis with no arguments will display this syntax diagram.

DISCUSSION:
	Whereis scans through all the directories on the current
	device, until it finds the 'filename' specified.  When that
	is found, the path of directories leading to that file is
	printed.  For example:
	1> CD DF0:		/* device searched will be df0: */
	1> WHEREIS mountlist	/* Search for file 'mountlist' */
	:devs/Mountlist		/* Whereis prints path to the file */
	1>

	You can stop Whereis at any time by pressing Control-C, or
	by sending the BREAK command to the CLI that Whereis is
	running inside of.

SWITCHES:
	None, any, or all of the switches may be specified.

	[-A] By default, Whereis exits after the file is found.  If
	you use the -a (all) switch, then Whereis will scan through
	the entire device (disk).  Thus, if you think there are several
	files with the same name, you can use the -a switch to show
	all of their paths.

	[-V] Whereis by default works silently.  If you specify the
	-v (verify) switch, then Whereis will display in a CON:
	window the directories it is currently searching through.

	[-D DEVICE] Whereis only searches one device (disk drive) at
	a time.  By default, Whereis searches the device containing
	the directory you are currently in.  If you want to search
	a different device, you can specify it using the -d switch.
	For example, if you are in df0: but want to search on df1:,
	you can say:  WHEREIS -D DF1: file.
@//E*O*F whereis.doc//
chmod u=rw,g=r,o=r whereis.doc
 
echo x - whereis.uue
sed 's/^@//' > "whereis.uue" <<'@//E*O*F whereis.uue//'
begin 0 Whereis
M   #\P         %          0    "    '@   #\    2   #E@   ^D 
M   "3OD           /L     0    0    "         _(   /I    'DCG
M #HH;P 4(&\ &")O !Q%^@ Z3^__="9/+'D    $3J[]]G#_2AM7R/_\1H!G
M$B\ 2&\ !$A43KD    P3^\ #$_O (Q,WUP 3G46P$YU2.< .B9O !0@;P 8
M0^\ '$7Z !(L>0    1.KOWV3-]< $YU%L!.=0   ^P    !     @   #H 
M       #\@   ^D    _2.<@ BQY   !S$SO  8 #$ZN_^),WT $3G4  "\.
M+'D   ',(B\ "$ZN_]PL7TYU2.<P BQY   !S$SO  X $$ZN_]!,WT ,3G4 
M "\.+'D   ',3J[_RBQ?3G4O#BQY   !S$ZN_\0L7TYU2.<@ BQY   !S$SO
M  8 #$ZN_ZQ,WT $3G4  "\.+'D   ',(B\ "$ZN_Z8L7TYU2.<@ BQY   !
MS$SO  8 #$ZN_YI,WT $3G4  $CG( (L>0   <Q,[P &  Q.KO^43-] !$YU
M   O#BQY   !S"(O  A.KO^"+%].=2\.+'D   ',(B\ "$ZN_W L7TYU   #
M[     L    $    [    -@   "^    H@   (P   !R    8    %     V
M    (     8        #\@   ^D    2+PXL>0   <A,[P #  A.KO\Z+%].
M=0  +PXL>0   <@B;P (("\ #$ZN_RXL7TYU+PXL>0   <A,[P #  A.KO[.
M+%].=0     #[     ,    $    -    !P    $         _(   /I   #
MEB//   !X"/    !Z"/(   ![$*Y   !Y"QY    !"/.   !R)/)3J[^VBA 
M2JP K&<  *AA  %L(&P K-'(T<@@:  0T<C1R$CG(#!%^0   G!'^0   ?!T
M 7  $!@FRF "%-A1R/_\0AH@.0   >@@>0   >P2&%. ;QX, 0 @;_12@B;*
M8 H2&%. # $ (&\$%,%@\D(:8-Q"&D*;( ),WPP$2'D   'P+P!.N0   $PC
MP    =1.N0   %PCP    =@CP    =Q.N0  !S)P "YY   !X$YU80  QF$ 
M + CP    >1"IR\ )$ @*@ D9Q L>0   <P@0"(H  !.KO^"(BH (&<H)#P 
M  /M3J[_XB/    !U"/    !V"/    !W&<*Y8@@0"EH  @ I$ZY   ',G  
M8 0@+P $+GD   '@+P L>0    0@.0   <QG B) 3J[^8DJY   !Y&<.3J[_
M?")Y   !Y$ZN_H8@'TYU2.<!!BX\  . !RQX  1.KO^43-]@@'!D8+!![ !<
M3J[^@$'L %Q.KOZ,3G5"N0   <Q#^0   W @/    !Y.KOW8(\    ',9[9.
M=0    $                                                     
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                                            
M                                  !D;W,N;&EB<F%R>0!P "\ +P!.
MN0   #!0CP@   QG"G !(\    R(3G4O/   $ !"ITZY    ,%"/< !.=4Y6
M   @;@ ($!!* &<8#   86T,#   >FX&!@#_X!" 4JX "&#>3EY.=4Y6__@M
M;@ (__@@;O_X+4C__+'\     &<4+5#_^"\H  0O"$ZY    &%"/8-Q.7DYU
M3E;_3 RY     0  #(QF  "$2'D   I$2&[_H$ZY   -S%"/+RX #$AN_Z!.
MN0  #010CTAY   *3DAN_Z!.N0  #010CTAN_Z!.N0  #C18CR\ 2&[_H"\Y
M   ,E$ZY    ,$_O  Q2@&8H2'D   I33KD   R\6(]P 2/    ,A"\N  A.
MN0   (A8CW !3EY.=6$ _MQ3@&8:< $CP   #(0O+@ (3KD   "(6(]P 4Y>
M3G61R"\Y   +D"\N  @M2/_T+4C_^$ZY    G%"/+SD   N0+RX "$ZY    
MN%"/2H!G  # ('D   N04(@O"$ZY   .-%B/!H     .+SP  0  +P M0/],
M3KD     4(\M0/_P2H!F,DAY   *9DZY   ,O%B/+R[_^&$ _IQ8CW !(\  
M  R$+RX "$ZY    B%B/< %.7DYU(&[_\$*0(6[_3  $(GD   N0(6D >  (
MT/P #")Y   +D%")+PDO"$ZY   -S%"/2J[_]&80(&[_\"U(__@M2/_T8 #_
M/B!N__ B;O_T(H@M2/_T8 #_+"UN__C_\$JN__!G  $4(&[_\$JH  AJ>-#\
M  PO"$AN_Z!.N0  #<Q0CTAN_Z!A /W,6(](>0  "^1(;O^@3KD   V,4(]*
M@&9&(&[_\-#\  PO""\N  Q(>0  "GM.N0  #+Q/[P ,#+D    !   ,A&8<
M+R[_^&$ _:Q8CR\N  A.N0   (A8CW !3EY.=2!N__!*J  (:WHO+@ ,2&[_
M4$ZY   -S%"/(&[_\-#\  PO"$AN_U!.N0  #010CW#^+P!(;O]03KD   !L
M4(](>0  "H-(;O]0+4#__$ZY   -!%"/2&[_4"\N__QA /UH4(]3@&8<+R[_
M^&$ _2A8CR\N  A.N0   (A8CW !3EY.=2!N__ M4/_P8 #^Z"\N__AA /T 
M6(\O+@ (3KD   "(6(]P $Y>3G5.5@  2JX "&<,+RX "$ZY   ,W%B/#*X 
M   !  QF%$AY   +E$AY   *A4ZY   ,O%"/< $O $ZY    Z%B/3EY.=4Y6
M_Z0O/   $ !"ITZY    ,%"/(&X #"\02'D   N43KD   W,4(]".0  "^1(
M>0  "K!(>0  ##1.N0  #<Q0CW !(\    R$<  CP   #(@CP   #(PCP   
M#) ,K@    ( "&P,< $O $*G80#_3%"/< $M0/^D("[_I+"N  AL  $BY8 @
M;@ ,T< B4! 1#   +68  -Y2B1 12(!(P'(P!($    (:P  F+"[& AF\$[[
M& 8   !$8   0    &1@   X    5F   "0   !V8   '    $%@   *    
M86    )"N0  #(1@  "N< $CP   #(Q@  "B< $CP   #) @+O^D4H M0/^D
ML*X "&80< $O $AY   *LF$ _II0CR N_Z3E@"!N  S1P"\02'D   PT3KD 
M  W,4(]@6B N_Z3E@"!N  S1P"\02'D   K+2&[_J$ZY    4$_O  QP 2\ 
M2&[_J&$ _DQ0CV H("[_I.6 (&X #-' +Q!(>0  "^1.N0  #<Q0CTAY   +
MY&$ ^N)8CU*N_Z1@ /[6$#D   OD2@!F$' !+P!(>0  "N!A /X 4(\,N0  
M  $   R,9BPO/    ^Y(>0  "P1.N0    !0CR/    ,E$J 9@Y"ITAY   +
M'&$ _<A0CW#^+P!(>0  ##1.N0   &Q0CRU __A*@&9 #+D    !   ,C&8.
M+SD   R43KD    <6(](>0  ##1(>0  "T)(;O^H3KD   !03^\ #$*G2&[_
MJ&$ _6Y0CR\N__A.N0   -18CR\\  $  "\\   !!"U __Q.N0    !0CR/ 
M   +D$J 9B@,N0    $   R,9@XO.0  #)1.N0   !Q8CT*G2'D   M@80#]
M&%"/2'D   PT+R[_^&$ ^B10CR!Y   +D"\\   !!"\(3KD    84(\O+O_\
M3KD   #46(\,N0    $   R,9@XO.0  #)1.N0   !Q8CPRY     0  #(AF
M#DAY   +@DZY   ,W%B/3EY.=5-C86YN:6YG(  N+BX* %=R:71E*"D@17)R
M;W(@*#\I"@!/=70@;V8@;65M;W)Y(&5R<F]R"@ E;',E;',* "\ 57-A9V4Z
M("5L<R!;+6%=(%LM=ET@6RUD(&1E=FEC95T@9FEL96YA;64* #H 3F\@9&5V
M:6-E(&YA;64@<W!E8VEF:65D %5N:VYO=VX@<W=I=&-H("<E;',G $YO(&9I
M;&5N86UE('1O('-E87)C:"!F;W(@<W!E8VEF:65D $-/3CHP+S$Q+S8T,"\V
M-"]7:&5R96ES $-O=6QD(&YO="!O<&5N('9E<F)O<V4@8V]N<V]L92!W:6YD
M;W< 0V]U;&0@;F]T(&%C8V5S<R!D979I8V4@)R5L<R< 3F]T(&5N;W5G:"!M
M96UO<GD@=&\@86QL;V-A=&4@9FEB $-T<FPM0R!"4D5!2P  R+X )LC0 ";(
MX@ FR/0 )LD& ";)&  FR2H )LD\ ";)3@ FR6  )LER ";)A  FR98 )LFH
M ";)N@ FR<P )LG> ";)\  FRF8  #I\ "5K*       )H<J    !@   ^D 
M 0 ! ";*G  FRI@@45B1 "=4#  FAS8 )LI:      ', ";*A@ FAT8 )LJL
M   [&  E:R@      ":'50    @   /I  $  0 FRN( )LK>__S1P  FOX@ 
M)H=A ";*H      !K@ FRLP )H=P ";*\@  .[P )6LH       FAW\    %
M   #Z0 !  $ )LLH ";+)/_T("X )Y', ":'BP F2.<P "8O  PD+P 02&\ 
M%"\"+P-.N0    !/[P ,3-\ #$YU+P(D+P (2&\ #"\"+SD   '83KD     
M3^\ #"0?3G4O B0O  @O DAY   - "\Y   !V$ZY   ,F$_O  PD'TYU   E
M<PH 3E;__"\N  A.N0  #C18CR!N  C1P"U(__P@;O_\4J[__")N  P0$1" 
M4JX #$H 9N@@+@ (3EY.=4Y6__PO+@ (3KD   XT6(\@;@ (T< M2/_\("X 
M$%.N !!*@&\:(&X #! 0(F[__!* 4JX #$H 9P92KO_\8-H@;O_\0A @+@ (
M3EY.=4Y6   @;@ ($! @;@ ,$A"P 6842@!F!G  3EY.=5*N  A2K@ ,8-QP
M "!N  @0$'( (&X #!(0D(%.7DYU  !.5O_\+6X "/_\(&[__%*N__PB;@ ,
M$!$0@%*N  Q* &;H("X "$Y>3G5.5O_\+6X "/_\2JX $&\@(&X #! 0(F[_
M_!* 4JX #$H 9PQ2KO_\3G%3K@ 08-H@;O_\0A @+@ (3EY.=4Y6__Q"KO_\
M(&X "-'N__P0$$H 9P92KO_\8.P@+O_\3EY.=0   ^P    $     0  #-  
M  RN   )<   ")     4     @  "@8   F*   *(   "<8   E8   )#   
M!R@   DV   &?   !.@   36   &X@  !KH   8V   %3@  !+0   22   $
M:@   *X   "Z    !P    ,   FB   %&@  "?H   /^   '0    Z0   .$
M    <0    0   U(   -#@  #.P   SR   ,Y@  #,H   HZ   &_@  !?( 
M  <<   &$@  !3    1^   %    !%8   :2   &;   !$H   0X   (O@  
M"&X   =N   '5   !E8   76   %A   !"@   HL   *&@  "A(   GL   )
MW   "<    FX   )J@  "6    E2   )2@  "3    D4   (^   "-H   C&
M   (N   "&@   @T   (*   "!P   >,   'A@  !X    =X   ':   !UP 
M  =.   '$   !B    7H   %>   !6@   5$   $]@  !-X   3$   $J@  
M!(@   1D   $%    Y0   HT   )T   "68   D@   )!@  ".@   B&   (
M3@  !V(   <6   &A   !@P   4J   $>   !$    0>   !-    ,P   &Z
M   !J@   :0   %J   !7@   5    %"   !(@   1P   $6    ]@   .0 
M  #4    Q@   ,    "T    I@   '(   !L    5    $X    @    %   
2  X    (     @        /R
 
end
@//E*O*F whereis.uue//
chmod u=rw,g=r,o=r whereis.uue
 
echo x - whereis.c
sed 's/^@//' > "whereis.c" <<'@//E*O*F whereis.c//'
/* WHEREIS -> Report the path location to a given file	*/
/* Copyright 1987 Daniel Green.  Freely Redistributable	*/
/* No warranty expressed or implied.  Use at own risk   */
/* Compile:	with Lattice C version 3.03		*/
/* Link:	with AStartup.obj			*/

#include "exec/types.h"
#include "exec/memory.h"
#include "libraries/dos.h"
#include "libraries/dosextens.h"

/* Data Types */
struct	dirnode	{
	struct	dirnode	*next;		/* Next node in list */
	int	size;			/* Size of this node (bytes) */
	int	type;			/* File type */
	char	name[1];		/* File name */
};

/* Constants */
#define	DIRNODESIZE	sizeof(struct dirnode)
#define	FIBSIZE		sizeof(struct FileInfoBlock)

/* External routines returning non-ints */
extern	char			*AllocMem();
extern	struct	FileLock	*Lock();
extern	struct	FileLock	*CurrentDir();
extern	long			*Open();

/* Global Variables */
struct	FileInfoBlock	*fib;	/* Used for reading directories    */
char	progname[80];		/* Name of this program (argv[0])  */
char	searchname[80];		/* Filename to be searched for     */
char	device[80];		/* Alternate device to search      */
int	flag_first;		/* TRUE -> exit after first match  */
int	flag_break;		/* TRUE -> Ctrl-C pressed, so exit */
int	flag_verbose;		/* TRUE -> Print status messages   */
int	flag_device;		/* TRUE -> Search other device     */
long	verbose_fp;		/* File ptr for verbose output     */

/*
 * cbreak.  Check for a BREAK.  Returns TRUE if detected.
 */
int	cbreak()
{
	/* See if a control C pressed */
	if (SetSignal(0L,0L) & SIGBREAKF_CTRL_C) {
		flag_break = TRUE;
		return(TRUE);
	}

	/* Otherwise reset break and continue */
	SetSignal(0L,SIGBREAKF_CTRL_C);
	return(FALSE);
}

/*
 * Upcase.  Convert a string inline to upper case
 */
Upcase(s1)
	char	*s1;
{
	while (*s1 != '\0') {
		if ((*s1 >= 'a') && (*s1 <= 'z'))
			*s1 += ('A' - 'a');
		s1++;
	}
}

/*
 * FreeList.  DeAllocate a list of dirnodes
 */
FreeList(firstnode)
	struct	dirnode	*firstnode;
{
	struct	dirnode	*curnode, *nextnode;

	/* For each node in the list */
	nextnode = firstnode;
	while ((curnode = nextnode) != NULL) {
		nextnode = curnode->next;
		FreeMem(curnode,curnode->size);
	}
}

/*
 * ReadDir.  Recursive routine.  Given a lock on the current directory
 * and the path to that directory, this scans the dir.  Any filenames
 * are compared to the searchname and matches are printed.  For each
 * subdirectory, ReadDir is again evoked with a lock on the sub dir
 * and an updated path.  When all subdirectories are exhausted, this
 * procedures UnLocks the lock that it was given, and then the
 * procedure returns.  Returns TRUE if no more directories should be
 * read.
 */
int	ReadDir(dirlock,pathname)
	struct	FileLock	*dirlock;
	char	*pathname;
{
	struct	FileLock	*newlock;
	struct	dirnode		*firstnode, *lastnode, *tmpnode;
	char	tbuf[80];
	char	newpath[80];
	int	i;

	/* If verbose mode on, write the path that is being searched */
	if (flag_verbose == TRUE) {
		strcpy(tbuf,"Scanning ");
		strcat(tbuf,pathname);
		strcat(tbuf,"...\n");
		if (Write(verbose_fp,tbuf,strlen(tbuf)) == -1) {
			
			/* Write i/o error [should never happen] */
			printf("Write() Error (?)\n");
			flag_first = TRUE;
			UnLock(dirlock);
			return(TRUE);
		}
	}

	/* Check for break key */
	if (cbreak() == TRUE) {
		
		/* Simulate early exit condition */
		flag_first = TRUE;
		UnLock(dirlock);
		return(TRUE);
	}

	/* Initialize dirnode list */
	firstnode = NULL;
	lastnode = NULL;

	/* Read all file and subdirectory names in the current directory */
	/* and store them in a list of dirnodes, pointed to by firstnode */
	/* This must be done (as opposed to just checking each name made */
	/* by ExNext) because of the recursiveness.  If you use ExNext,  */
	/* and then skip to a subdir and use ExNext, and then return,    */
	/* the original ExNext gets very confused.  Therefore, you have  */
	/* to read all directory names into memory first before you      */
	/* handle them.  This necessitates the dirnode stuff.            */

	/* Get the first entry in directory                              */
	/* Actually, this returns the NAME of the directory, and not its */
	/* first content.  It still must be called to initialize ExNext, */
	/* which is the routine that actually returns the contents       */
	Examine(dirlock,fib);

	/* While there are still things in the directory, do: */
	while (ExNext(dirlock,fib) != 0) {

		/* Allocate data storage for this element */
		i = DIRNODESIZE + strlen(fib->fib_FileName);
		if ((tmpnode = (struct dirnode *)
			AllocMem(i,MEMF_CLEAR)) == NULL) {

			/* Argh! Out of memory.  Simulate exit condition */
			printf("Out of memory error\n");
			FreeList(firstnode);
			flag_first = TRUE;
			UnLock(dirlock);
			return(TRUE);
		}

		/* Fill data storage node */
		tmpnode->next = NULL;
		tmpnode->size = i;
		tmpnode->type = fib->fib_EntryType;
		strcpy(tmpnode->name,fib->fib_FileName);
		
		/* Add this node to the list of dirnodes */
		if (lastnode == NULL) {
			lastnode = tmpnode;
			firstnode = tmpnode;
		}
		else {
			lastnode->next = tmpnode;
			lastnode = tmpnode;
		}
	}

	/* For each dirnode, if it is a file then see if it is the */
	/* one we are searching for.  If it is a directory, then   */
	/* call ReadDir() to search the directory for the file.    */

	tmpnode = firstnode;
	while (tmpnode != NULL) {

		/* Is this a file? */
		if (tmpnode->type < 0) {
			
			/* Copy the file name into a buffer, and caps it */
			strcpy(tbuf,tmpnode->name);
			Upcase(tbuf);

			/* Did we find the file? */
			if (strcmp(tbuf,searchname) == 0) {
				printf("%ls%ls\n",pathname,tmpnode->name);

				/* If we're supposed to stop at first, */
				/* then we can exit this sub here */
				if (flag_first == TRUE) {
					FreeList(firstnode);
					UnLock(dirlock);
					return(TRUE);
				}
			}
		}

		/* Is this a directory? */
		if (tmpnode->type >= 0) {

			/* Build the pathname to this subdir */
			strcpy(newpath,pathname);
			strcat(newpath,tmpnode->name);
			
			/* Get a lock on this subdir */
			newlock = (struct FileLock *)Lock(newpath,ACCESS_READ);

			/* Complete the path specification */
			strcat(newpath,"/");

			/* Search this dir for the file in question */
			if (ReadDir(newlock,newpath) == TRUE) {

				/* If file was found, exit */
				FreeList(firstnode);
				UnLock(dirlock);
				return(TRUE);
			}
		}
		
		/* Examine the next dirnode */
		tmpnode = tmpnode->next;
	}

	/* We didn't find anything.  Cleanup and exit */
	FreeList(firstnode);
	UnLock(dirlock);
	return(FALSE);
}

/*
 * Leave if there is an error.  First arg is optional error message.
 * If second arg is TRUE, then usage information is given.
 */
leave(msg,usage)
	char	*msg;
	int	usage;
{
	if (msg != NULL)
		puts(msg);
	if (usage == TRUE)
		printf("Usage: %ls [-a] [-v] [-d device] filename\n",progname);
	Exit(1);
}

/*
 * Whereis.
 */
main(argc,argv)
	int	argc;
	char	*argv[];
{
	struct	FileLock	*olddir, *dirlock;
	char	buf[80];
	int	i;

	/* Set initial conditions */
	SetSignal(0L,SIGBREAKF_CTRL_C);
	strcpy(progname,argv[0]);
	searchname[0] = '\0';
	strcpy(device,":");
	flag_first = TRUE;
	flag_break = FALSE;
	flag_verbose = FALSE;
	flag_device = FALSE;

	/* Check for valid arguments */
	if (argc < 2)
		leave(NULL,TRUE);

	/* Parse args for flags and file */
	i = 1;
	while (i < argc) {
		if (argv[i][0] == '-') {
			switch (argv[i][1]) {
				case 'a':
				case 'A':
					flag_first = FALSE;
					break;
				case 'v':
				case 'V':
					flag_verbose = TRUE;
					break;
				case 'd':
				case 'D':
					flag_device = TRUE;
					if (++i == argc)
						leave("No device name specified", TRUE);
					strcpy(device,argv[i]);
					break;
				default:
					sprintf(buf,"Unknown switch '%ls'",argv[i]);
					leave(buf, TRUE);
			}
		}
		else {
			/* Save the filename to be searched for */
			strcpy(searchname,argv[i]);
			Upcase(searchname);
		}
		i++;
	}

	/* Make sure a filename was given */
	if (searchname[0] == '\0')
		leave("No filename to search for specified", TRUE);

	/* If in verbose mode, open up the verbose file */
	if (flag_verbose == TRUE) {
		if ((verbose_fp = (long)Open("CON:0/11/640/64/Whereis",MODE_NEWFILE)) == 0)
			leave("Could not open verbose console window", FALSE);
	}

	/* Save the current directory position */
	if ((dirlock = (struct FileLock *)Lock(device,ACCESS_READ)) == 0) {
		if (flag_verbose == TRUE)
			Close(verbose_fp);
		sprintf(buf,"Could not access device '%ls'",device);
		leave(buf,FALSE);
	}
	olddir = (struct FileLock *)CurrentDir(dirlock);

	/* Allocate the file info block */
	if ((fib = (struct FileInfoBlock *)AllocMem(FIBSIZE,MEMF_CLEAR)) == NULL) {
		if (flag_verbose == TRUE)
			Close(verbose_fp);
		leave("Not enough memory to allocate fib", FALSE);
	}

	/* Scan the device root for the file */
	ReadDir(dirlock,device);

	/* Free the file info block */
	FreeMem((char *)fib, FIBSIZE);

	/* Return to the original directory */
	CurrentDir(olddir);

	/* Close the verbose window if it was opened */
	if (flag_verbose == TRUE)
		Close(verbose_fp);

	/* Print break message if necessary */
	if (flag_break == TRUE)
		puts("Ctrl-C BREAK");
}
@//E*O*F whereis.c//
chmod u=rw,g=r,o=r whereis.c
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
      45     280    1673 whereis.doc
     114     869    6868 whereis.uue
     358    1324    9087 whereis.c
     517    2473   17628 total
!!!
wc  whereis.doc whereis.uue whereis.c | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0
-- 
ARPA:  hsgj@tcgould.tn.cornell.edu
UUCP:  ihnp4!cornell!batcomputer!hsgj   BITNET:  hsgj@cornella

kent@xanth.UUCP (Kent Paul Dolan) (09/29/87)

In article <2490@batcomputer.tn.cornell.edu> hsgj@batcomputer.tn.cornell.edu (Dan Green) writes:
>
>A while ago I promised that I'd post a "whereis" utility to
>comp.sources.amiga.  I posted it on Sept 7, 1987.  Today is Sept 28
>and it still hasn't shown up yet.  Rather then trying again, I
>am simply going to send this to comp.sys.amiga.  Hopefully this
>does not anger too many people.

I'm NOT angry.  However, we are a small (12000 subscribers) part of the whole
USENet community, and when all the sources and binaries were being posted here
a while back, there were loud threats all along the backbone to cut us off
at the knees, because we had the (one of the?) heaviest byte counts of all
newsgroups.  Recently, there have been two hard-drive backup utilities posted
here, now the routine to whose posting this is a response, and several other
people have also grown too impatient to wait, and added fuel to the fire.

Now hard drive users are probably a small part of the Amiga community (I sure
wish I could spring for one!) and I don't think such a small audience is going
to die off if they have to wait six weeks extra for free software.  I know that
developers of public domain stuff want the feedback, the bug reports, the
glory, or whatever.  Fine, but please be patient.

Every day or two, new files show up from doc in comp.sources.amiga and in
comp.binaries.amiga; the newsgroups are live.  After seeing all the extra
care doc took with my own posting (thanks again Craig!) to make sure it came
out in a form suitable for all the Amiga community, I was pretty happy that I
had waited, even if the wait was five weeks.

Can't we all be ladies and gentlemen about this, and stifle our impatience?
Being a moderator is a killer job, and doc had some pretty severe start up
troubles, so he has some catching up to do.  Personally, I won't take anything
that doesn't come through his hands anymore; it sure is nice to have someone
else filter out the Trojan horses and worms; I don't know how.

Let's NOT put ourselves on the net-god's hit list again, OK?  Send it to doc,
and wait.  If you think he died, or graduated, or something, send him a note
and ask him if he got your stuff, and if there is a problem getting it out.

Thanks.

Kent, the man from xanth.

		His expression lit up.  "Hey, you wouldn't be
		a dope smuggler, would you?"

		Rail looked confused.  "Why would anyone wish
		to smuggle stupidity when there is so much of
		it readily available?"

			-- Alan Dean Foster, GLORY LANE

tadguy@xanth.UUCP (09/30/87)

In article <2599@xanth.UUCP> kent@xanth.UUCP (Kent Paul Dolan) writes:
>In article <2490@batcomputer.tn.cornell.edu> hsgj@batcomputer.tn.cornell.edu (Dan Green) writes:
>>A while ago I promised that I'd post a "whereis" utility to
>>comp.sources.amiga.  I posted it on Sept 7, 1987.  Today is Sept 28
>>and it still hasn't shown up yet.
>Can't we all be ladies and gentlemen about this, and stifle our impatience?
>Being a moderator is a killer job, and doc had some pretty severe start up
>troubles, so he has some catching up to do.
>
>Let's NOT put ourselves on the net-god's hit list again, OK?  Send it to doc,
>and wait.  If you think he died, or graduated, or something, send him a note
>and ask him if he got your stuff, and if there is a problem getting it out.
>
>Kent, the man from xanth.

I think Mr. Green has a valid point.  The .sources and .binaries group
are only useful if material submitted to them gets distributed in a
timely manner.

Does "doc" send acknowledgements to people indicating that their
submission was received and what kind of delay they can expect?  If not,
I would suggest that he start doing so.  That would encourage people to
be more patient and let them know that their posting didn't go into a void.

Additionally, if he is still having mail trouble (since he is at Purdue,
I wouldn't be suprised -- I have had serious difficulty trying to get
through their mailers in the past) or finds his workload too much to be
able to deal with comp.{sources,binaries}.amiga postings in a reasonable
time then perhaps it is time for another moderator to come forward.

I'm not trying to slight "doc" (who has been doing a good, if erratic
job), but these things will happen from time to time...

Just a thought...

	...tad

cmcmanis%pepper@Sun.COM (Chuck McManis) (09/30/87)

Kent mentions in his article that the reason for not posting source
to the group was to keep the cost of sending comp.sys.amiga (and info-amiga
if it still exists) around the world down. And this was and still is true.
Generally, it is better to have the two types of messages split out. 
Personally, I would like to see a non-moderated sources group but that is
not up to me to decide. However now we get to the interesting stuff.

comp.sys.amiga is still in the top 10 newsgroups. On BIX the groups that
make up the Amiga 'area' (amiga, amiga.user, amiga.dev, amiga.com) are
the top conference consistently. And to top it off their stock has 
closed over 10 twice now. I guess the theme of this article is all 
of the leading indicators are pointing up, indicating a long and fruitful
life for our favorite micro. 

--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@sun.com
These opinions are my own and no one elses, but you knew that didn't you.

rminnich@udel.EDU (Ron Minnich) (10/01/87)

In article <2599@xanth.UUCP> kent@xanth.UUCP (Kent Paul Dolan) writes:
>Can't we all be ladies and gentlemen about this, and stifle our impatience?
>Being a moderator is a killer job, and doc had some pretty severe start up
>troubles, so he has some catching up to do.  Personally, I won't take anything
>that doesn't come through his hands anymore; it sure is nice to have someone
>else filter out the Trojan horses and worms; I don't know how.
>
>Let's NOT put ourselves on the net-god's hit list again, OK?  Send it to doc,
>and wait.  If you think he died, or graduated, or something, send him a note
>and ask him if he got your stuff, and if there is a problem getting it out.

  It is a nice idea, and i appreciate that criag is under a lot of
stress from the work, but it won't work. I have tried going the 
Comp.sources.amiga route; i send the stuff, i get no acknowledgement,
i send a request, i hear nothing, ... in one case i still do not 
know the fate of stuff i sent 10 months ago. I will wait for four 
weeks, but after that time i will just post. If i heard SOME 
sort of response that would be one thing but for the most part
purdue from my end has been a black hole. For all i know the mail 
is not even getting through!

And yes, craig is doing a heck of a good job. 
-- 
ron (rminnich@udel.edu)

fgd3@jc3b21.UUCP (Fabbian G. Dufoe) (10/04/87)

in article <542@louie.udel.EDU>, rminnich@udel.EDU (Ron Minnich) says:
> 
> In article <2599@xanth.UUCP> kent@xanth.UUCP (Kent Paul Dolan) writes:
>>Can't we all be ladies and gentlemen about this, and stifle our impatience?
>>Being a moderator is a killer job, and doc had some pretty severe start up
>>troubles, so he has some catching up to do.  Personally, I won't take anything
>>that doesn't come through his hands anymore; it sure is nice to have someone
>>else filter out the Trojan horses and worms; I don't know how.
>>
>>Let's NOT put ourselves on the net-god's hit list again, OK?  Send it to doc,
>>and wait.  If you think he died, or graduated, or something, send him a note
>>and ask him if he got your stuff, and if there is a problem getting it out.
> 
>   It is a nice idea, and i appreciate that criag is under a lot of
> stress from the work, but it won't work...

     The delays are only part of the problem.  I don't know if the problems
I see are the result of having a moderated newsgroup or if they stem from
some other problem.  For whatever reason, I seldom see any Amiga source
that isn't posted to comp.sys.amiga.  Perhaps there is another approach
which would work better.

     Instead of posting source to comp.sys.amiga because the response from
comp.sources.amiga isn't fast enough, how about posting an abstract of the
program to comp.sys.amiga and posting the source to comp.sources.amiga.  In
the abstract mention the source was sent to comp.sources.amiga.  Also
offer to mail source upon request.  Then, after waiting a week or two,
count the requests for source by mail.  If there are more than ten, post to
comp.sys.amiga.  Otherwise just mail the source to those who requested it.

     That would avoid increasing the traffic on comp.sys.amiga
unnecessarily.  If, as some people claim, there really isn't a problem with
comp.sources.amiga, there will be no need to mail source or post it to
comp.sys.amiga.  If the problem is limited to just a few sites the mail
option will take care of it.  But if comp.sources.amiga really isn't
working the source will still get distributed.

     An added benefit of that approach is the archives at
comp.sources.amiga will be complete, since source will still be posted
there.

     That seems to be pretty close to what people are doing anyway.  Only
sometimes folks post to comp.sys.amiga immediately.  I did it myself with
my shell archive programs, but next time I'll try the approach I suggested
here.

--Fabbian Dufoe
  350 Ling-A-Mor Terrace South
  St. Petersburg, Florida  33705
  813-823-2350

UUCP: ...gatech!codas!usfvax2!jc3b21!fgd3 

richard@gryphon.CTS.COM (Richard Sexton) (10/06/87)

In article <184@jc3b21.UUCP> fgd3@jc3b21.UUCP (Fabbian G. Dufoe) writes:
>     The delays are only part of the problem.  I don't know if the problems
>I see are the result of having a moderated newsgroup or if they stem from
>some other problem.  For whatever reason, I seldom see any Amiga source
>that isn't posted to comp.sys.amiga.  Perhaps there is another approach
>which would work better.
>
>     Instead of posting source to comp.sys.amiga because the response from
>comp.sources.amiga isn't fast enough, how about posting an abstract of the
>program to comp.sys.amiga and posting the source to comp.sources.amiga.  In
>the abstract mention the source was sent to comp.sources.amiga.  Also
>offer to mail source upon request.  Then, after waiting a week or two,
>count the requests for source by mail.  If there are more than ten, post to
>comp.sys.amiga.  Otherwise just mail the source to those who requested it.
>

[...]

>
>--Fabbian Dufoe

Or announce it here, and post it to comp.sources.amiga and alt.sources.
-- 
Richard J. Sexton
INTERNET:     richard@gryphon.CTS.COM
UUCP:         {hplabs!hp-sdd, sdcsvax, ihnp4, nosc}!crash!gryphon!richard

"It's too dark to put the keys in my ignition..."