[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page
Top Document: Unix - Frequently Asked Questions (4/7) [Frequent posting]
Previous Document: How do I check to see if there are characters to be read ... ?
Next Document: How can an executing program determine its own pathname?
-
Search the FAQ Archives
Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page
Top Document: Unix - Frequently Asked Questions (4/7) [Frequent posting]
Previous Document: How do I check to see if there are characters to be read ... ?
Next Document: How can an executing program determine its own pathname?
How do I find the name of an open file?
4.3) How do I find the name of an open file?
In general, this is too difficult. The file descriptor may
be attached to a pipe or pty, in which case it has no name.
It may be attached to a file that has been removed. It may
have multiple names, due to either hard or symbolic links.
If you really need to do this, and be sure you think long
and hard about it and have decided that you have no choice,
you can use find with the -inum and possibly -xdev option,
or you can use ncheck, or you can recreate the functionality
of one of these within your program. Just realize that
searching a 600 megabyte filesystem for a file that may not
even exist is going to take some time.
Top Document: Unix - Frequently Asked Questions (4/7) [Frequent posting]
Previous Document: How do I check to see if there are characters to be read ... ?
Next Document: How can an executing program determine its own pathname?
Part1 - Part2 - Part3 - Part4 - Part5 - Part6 - Part7 - Single Page
[ Usenet FAQs | Search | Web FAQs | Documents | RFC Index ]
Send corrections/additions to the FAQ Maintainer:
tmatimar@isgtec.com (Ted Timar)
Last Update November 22 2008 @ 00:12 AM