Path: utzoo!attcan!uunet!lll-winken!ames!pasteur!ucbvax!hplabs!hpfcdc!stroyan From: stroyan@hpfcdc.HP.COM (Mike Stroyan) Newsgroups: comp.sys.hp Subject: Re: find(1) function copying on HP-UX Message-ID: <5570176@hpfcdc.HP.COM> Date: 12 May 89 03:42:03 GMT References: <240028@grlab.UUCP> Organization: HP Ft. Collins, Co. Lines: 30 > 1) find has a -mountstop(or something like that)==>it recognizes mount > points. It would be nice to able to tell my program to not cross > mount points without having to tell it to explicitly "prune" all of > the mount point directories. You can recognize mount points by using stat(2) on each directory and watching for changes in the st_dev field. > 2) find recognizes file system types. You can check the file system type of a path by using getmntent(3X) to look up the /etc/mnttab entries and matching the mnt_fsname field to the mount point. The file system type is in the mnt_type field. > 3) HP-UX has "Context Dependent Files"(CDFs) that are really hidden > directories containing the file that is really referred to. > At any rate, the readdir routines read the contents of /etc as > including the regular file "inittab" instead of the hidden > directory "inittab+", but find(1) is able to display the hidden > directories with a "-hidden" switch or "-type H". I want to do this, > too. The CDFs can recognized by calling stat(2). The S_ISCDF macro described in stat(5) will test for a CDF using the st_mode field. You might also want to watch for symbolic links with the S_ISLNK macro from stat(5). Mike Stroyan, stroyan@hpstryn