Kbase 21139: Finding Out the File Name Using Its File Number -- UNIX
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  11/2/2004 |
|
Status: Verified
GOAL:
Finding Out the File Name Using Its File Number -- UNIX.
GOAL:
How to determine what file is being reference by file number.
FACT(s) (Environment):
UNIX
FIX:
Users are often confronted with Progress errors that reference files by file number. Such errors are:
SYSTEM ERROR: I/O error <n> in <program>, ret <n>, file <n>, addr <n>. (290)
and
SYSTEM ERROR: Seek error <value>, file <value>, addr <value>. (163)
Finding the file name can be somewhat difficult using Progress tools.
Nowadays there are new tools every day which can help us to identify the file handles that Progress is using. The tool which can help us to determine the file name in UNIX is lsof. This tool is not available in all UNIX systems but you will find it included in the major distributions. The file itself is usually located in /usr/sbin.
Using lsof is very easy and it provides interesting information about the libraries that a process uses, as well as information about what other resources are in use by a certain process; ports for instance.
Using:
# lsof | grep _progres | more
you'll see output similar to this from Red Hat Linux 6.0:
_progres 1032 root cwd DIR /home/certor/vers91b/db
_progres 1032 root rtd DIR /
_progres 1032 root txt REG /opt/dlc91b/bin/_progres
_progres 1032 root mem REG /lib/ld-2.1.92.so
_progres 1032 root mem REG /lib/libm-2.1.92.so
_progres 1032 root mem REG /lib/libdl-2.1.92.so
_progres 1032 root mem REG /usr/lib/libg++.so.2.7.2.8
_progres 1032 root mem REG /usr/lib/libstdc++-2-libc6.1-1-2.9.0.so
_progres 1032 root mem REG /lib/libc-2.1.92.so
_progres 1032 root mem REG /usr/lib/libstdc++.so.2.7.2.8
_progres 1032 root mem REG /lib/libnss_files-2.1.92.so
_progres 1032 root 0u CHR /dev/pts/1
_progres 1032 root 1u CHR /dev/pts/1
_progres 1032 root 2u CHR /dev/pts/1
_progres 1032 root 3r REG /opt/dlc91b/promsgs
_progres 1032 root 4r REG /opt/dlc91b/convmap.cp
_progres 1032 root 5u REG /home/certor/vers91b/db/lbipDluay
_progres 1032 root 6w REG /home/certor/vers91b/db/sports.lk
_progres 1032 root 7u REG /home/certor/vers91b/db/sports.db
_progres 1032 root 8w REG /home/certor/vers91b/db/sports.lg
_progres 1032 root 9u REG /home/certor/vers91b/db/sports.db
_progres 1032 root 10u REG /home/certor/vers91b/db/sports.db
_progres 1032 root 11u REG /home/certor/vers91b/db/sports.d1
_progres 1032 root 12u REG /home/certor/vers91b/db/sports.d1
_progres 1032 root 13u REG /home/certor/vers91b/db/sports.b1
_progres 1032 root 14u REG /home/certor/vers91b/db/sports_7.d1
_progres 1032 root 15u REG /home/certor/vers91b/db/sports_7.d2
_progres 1032 root 16u REG /home/certor/vers91b/db/sports_7.d2
_progres 1032 root 17u REG /home/certor/vers91b/db/sports_8.d1
_progres 1032 root 18u REG /home/certor/vers91b/db/sports_8.d2
_progres 1032 root 19u REG /home/certor/vers91b/db/sports_8.d2
_progres 1032 root 20u REG /home/certor/vers91b/db/sports_9.d1
_progres 1032 root 21u REG /home/certor/vers91b/db/sports_9.d2
_progres 1032 root 22u REG /home/certor/vers91b/db/sports_9.d2
_progres 1032 root 23u REG /home/certor/vers91b/db/sports_10.d1
_progres 1032 root 24u REG /home/certor/vers91b/db/sports_10.d2
_progres 1032 root 25u REG /home/certor/vers91b/db/sports_10.d2
_progres 1032 root 26u REG /home/certor/vers91b/db/sports_11.d1
_progres 1032 root 27u REG /home/certor/vers91b/db/sports_11.d2
_progres 1032 root 28u REG /home/certor/vers91b/db/sports_11.d2
_progres 1032 root 29u REG /home/certor/vers91b/db/sports_12.d1
_progres 1032 root 30u REG /home/certor/vers91b/db/sports_12.d2
_progres 1032 root 31u REG /home/certor/vers91b/db/sports_12.d2
_progres 1032 root 32u REG /home/certor/vers91b/db/srtGrjE10
_progres 1032 root 33r REG /opt/dlc91b/tty/adecomm.pl
_progres 1032 root 34r REG /opt/dlc91b/tty/ades.har.pl
_progres 1032 root 35r REG /opt/dlc91b/tty/prodict.pl
_progres 1032 root 36r REG /opt/dlc91b/tty/adeedit.pl
_progres 1032 root 37u REG /home/certor/vers91b/db/DBIZOiiOv
_progres 1032 root 38r REG /opt/dlc91b/tty/adecomp.pl
In this case the first few references point out the shared libraries
used by the Progress executables; these are not discussed in
this document. Following these however, comes this section:
_progres 1032 root 0u CHR /dev/pts/1
_progres 1032 root 1u CHR /dev/pts/1
_progres 1032 root 2u CHR /dev/pts/1
Here it identifies the files 0, 1, and 2 which correspond to the input, output, and error standard. After this section, comes all of the open files for this process, in this case a Progress client.
The file number in this case is in the fourth column. (NOTE: the listing could vary among the different flavors of UNIX -- this one is from Red Hat Linux 6.0.) The file number goes with the modality of the file; the "u" corresponds to RW (Read/Write), and the "r" means RO (Read Only).
Further details on this utility and its output can be found in the documentation -- man pages for lsof..