count of file descriptors

U

upendrao

Hi,
I have a requirement in which I need to count the number
of file descriptors associated with a file. To be more clear...A file
can be opened by several processes say in read only mode. I would like
to count the number of such file opens on particular file at a given
instant of time. Any C library function or unix command that can solve
my problem please...?
 
S

SM Ryan

(e-mail address removed) wrote:
# Hi,
# I have a requirement in which I need to count the number
# of file descriptors associated with a file. To be more clear...A file
# can be opened by several processes say in read only mode. I would like
# to count the number of such file opens on particular file at a given
# instant of time. Any C library function or unix command that can solve
# my problem please...?

No. Some unices provide something like this, some don't; outside of unix,
some do, some don't. Among those that do, there's no standardised
interface.

Perhaps if you're trying to serialise file access, you can try file locking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top