ftp.nice.ch/pub/next/unix/file/ofiles.README

This is the README for ofiles.tar.gz [Download] [Browse] [Up]

NAME
     ofiles - identify open files

SYNOPSIS
     ofiles [ -h ] [ -n ] [ -N ] [ -p ] [ -P _n ] [ -u ] [ -U _n ]
     _n_a_m_e_s

DESCRIPTION
     _O_f_i_l_e_s displays the command, process ID (PID), user ID
     (UID), file descriptor (FD), type, device, inode and some
     information about the name of files opened by NeXTStep 1.0a
     and 2.0 processes.

     An open file may be a regular file, a directory, a character
     special file, or a network file (Internet socket, NFS file
     or Unix domain socket.) A specific file may be selected by
     its path _n_a_m_e.

OPTIONS
     In the absence of any options, _o_f_i_l_e_s displays all open
     files belonging to all active processes.

     If any display request option is specified, all other
     displays must be specifically requested - e. g., if -n is
     specified for the display of Internet network files, NFS
     files won't be displayed unless -N is also specified.

     -h       This option selects a brief usage (help) output
              display.

     -n       This option selects the display of Internet network
              files.

     -N       This option selects the display of NFS files.

     -p       This option specifies that _o_f_i_l_e_s should print pro-
              cess identifiers only - e. g., so that the output
              may be piped to _k_i_l_l(1).

     -P _n     This option selects the display of files for the
              process whose ID is `n'.

     -u       This option selects the display of Unix domain
              socket files.

     -U _n     This option selects the display of files for the
              user whose user ID (UID) is `n'.

     _n_a_m_e_s    These are the path names of specific files to
              display.


OUTPUT
     _O_f_i_l_e_s displays for each open file:

     COMMAND                 contains the first seven characters
                             of the name of the Unix command
                             associated with the process.

     PID                     is the process identification (PID)
                             number of the process.

     UID                     is the user identification (UID)
                             number of the user to whom the pro-
                             cess belongs.

     FD                      is the file descriptor (FD) number
                             of the file or ``cd' if it is the
                             current working directory of the
                             process.  FD is followed by an
                             asterisk if the vnode of the file
                             has non-zero shared or exclusive
                             lock counts.

     TYPE                    is the type of the vnode associated
                             with the file (see <sys/vnode.h>).

                             ``unix'' is the type for a Unix
                             domain socket that is not associated
                             with a vnode.

     DEVICE                  contains the major and minor device
                             numbers for a character special,
                             block special, regular or directory
                             file;

                             or the protocol type of an Internet
                             network file;

                             or the client major and minor device
                             number of a remote, NSF file (under
                             NeXTStep 1.0a);

                             or the network major and minor dev-
                             ice number of a remote, NSF file
                             (under NeXTStep 2.0);

                             or the hexadecimal socket address of
                             a Unix domain file.

     INODE                   is the inode number of a local file
                             or the inode number of an NFS file
                             in the server host.

     NAME/[LOCAL][REMOTE]    is the name of the mount point and
                             file system on which the file
                             resides;

                             or the name of a file specified in
                             the _n_a_m_e_s option;

                             or the name of a character special
                             or block special device;

                             or the local and remote Internet
                             addresses of a network file;

                             or the address of a Unix domain
                             socket;

                             or the local and remote mount point
                             names of an NFS file.  (A NeXTStep
                             1.0a local mount point name will be
                             reduced to the last component of the
                             path.)

DIAGNOSTICS
     Errors are identified with messages on the standard error
     file.

     _O_f_i_l_e_s returns a one (1) if any error was detected, includ-
     ing the failure to locate any _n_a_m_e_s.  It returns a zero (0)
     if no errors were detected and if it was able to display
     information about all the specified _n_a_m_e_s.

EXAMPLES
     To display all open files, use:

          ofiles

     To display all open Internet and Unix domain files, use:

          ofiles -n -u

     To display all open files on device /dev/sd0a, use:

          ofiles /dev/sd0a

     To find the process that has /Homes/abe/foo open, use:

          ofiles /Homes/abe/foo

     To send a SIGHUP to the process that has /Homes/abe/bar
     open, use:

          kill -HUP `ofiles -p /Homes/abe/bar`

BUGS
     Since _o_f_i_l_e_s reads kernel memory in its search for open
     files, rapid changes in kernel memory may produce unpredict-
     able results.

     For reasons unknown, _o_f_i_l_e_s startup, while it is acquiring
     the major and minor device numbers of the files in /dev, is
     slow.

     _O_f_i_l_e_s has only been tested under NeXTStep versions 1.0a and
     2.0.

AUTHORS
     The NeXTStep version of _o_f_i_l_e_s was written by Victor A.
     Abell of the Purdue University Computing Center.  He ack-
     nowledges his debt to the work of Dan Bernstein, Michael
     ``Ford'' Ditto, Tom Dunigan, Alexander Dupuy, Vik Lall, Ray
     Moody, C. Spencer and Michael Spitzer, who contributed to
     versions of _o_f_i_l_e_s and its offspring.

SEE ALSO
     fs(5).

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.