[comp.sources.bugs] rh enhancements description

scott@grlab.UUCP (Scott Blachowicz) (05/11/89)

Hi-
	I too have made some enhancements/bug fixes to the rh program. I use
it for my file system snooping scripts to find disc space hogs/security
problems and general straightening. It's really nice to have all of the
expressions as macros in a file. At any rate, my question is, "should I
post the changes to the net or mail them to the author?" I haven't
located a context diff program on our system yet, and I don't know how
to use the man page macros (for updating the man page), yet...it needs a
little work before I could post it.

Among the changes are the following:

  -Added option to force following of symbolic links instead of just
   reporting info on the link itself.

  -Merged in the '-p' option from the sls program recently posted to the
   net.

  -Added some stuff for HP-UX support (Remote File Access network
   special files).

  -Added some convenience functions (isblk ischr isdir isreg islnk
	issock isnwk). For example, isblk is equivalent to
	((mode & S_IFMT) == S_IFBLK).

  -Added $$groupname to evaluate to the group id number of the name.
	(parallels the $username = uid of name).

  -Added some time formats:
		[yyyy/mm/dd], [yy/mm/dd], [yy/mm/dd.HH:MM], [yyyy/mm/dd.HH:MM],
		[yymmdd], [yymmdd.HHMM] (I use the latter formats frequently. The
		editor on the HP1000 will time stamp your file for you if you have
		a string that looks like <yymmdd.HHMM>, so I got used to that
		format).

  -Added a way to have filename matching based on the whole path. This
   is done by starting the pattern with a '^'. (e.g. "^/usr/lib/*").

  -Incorporated the first pattern matching patch posted by 
   cudcv@warwick.ac.uk (Rob McMahon).  This allows patterns such as
	"a?[b-y]\*\"z*".

  -I'd also fixed the parsing problem with ungetit'ing the last
   character in an expression string before Rob's posting, so that's
   there, too.

  -Added a couple of operators to deal with directories. One will
   "prune" the directory if its unary operand is true. The other will
	cause all of the files within a directory's subtree to "match".

Some things I'd like to do(our find(1) does all of these...ideas on how
I could do them would be appreciated):
  -Something to prevent mount point crossing.
  -fstype variable (local,nfs,???)
  -HP has files called "Context Dependent Files" (or CDFs) that are
   really hidden directories whose contents are selected based on the
   "context" of the system trying to access the file. (e.g. the kernal
	is referenced as "/hp-ux" but there is actually a hidden directory
	called "/hp-ux+" that contains kernals for the different nodes in the
	network that boot from that file system). At any rate, readdir
	resolves these, but I want to find a way to see the hidden
	directories.

-- 
Scott Blachowicz
USPS:  Graphicus                UUCP:    ...!hpubvwa!grlab!scott
       150 Lake Str S, #206     VoicePh: 206/828-4691
       Kirkland, WA 98033       FAX:     206/828-4236

decot@hpisod2.HP.COM (Dave Decot) (05/13/89)

>   -HP has files called "Context Dependent Files" (or CDFs) that are
>    really hidden directories whose contents are selected based on the
>    "context" of the system trying to access the file. (e.g. the kernal
> 	is referenced as "/hp-ux" but there is actually a hidden directory
> 	called "/hp-ux+" that contains kernals for the different nodes in the
> 	network that boot from that file system). At any rate, readdir
> 	resolves these, but I want to find a way to see the hidden
> 	directories.

When processing the file blah, also try stat(2) on the file "blah+".

If ((buf.st_mode & (S_IFMT | S_CDF)) == (S_IFDIR | S_CDF)), the file
"blah" is a hidden directory.  If you wish to descend it, use opendir() on
"blah+"; succesive calls to readdir() will return the contents of
the hidden directory.

In fact, any reference to "foo+", where foo is the name of a context
dependent file, is refers to the associated hidden directory.

Disclaimer: this information is only my opinion, not necessarily HP's.

Dave Decot
Hewlett-Packard Company
decot%hpda@hplabs.hp.com