Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ra!Isis.MsState.Edu!it1 From: it1@Isis.MsState.Edu (Tim Tsai) Newsgroups: comp.unix.programmer Subject: Checking if a process opened a file Message-ID: Date: 2 Apr 91 06:45:50 GMT Sender: usenet@ra.MsState.Edu Lines: 27 Nntp-Posting-Host: isis.msstate.edu Is it possible to check if a process (possibly from another machine via NFS) opened a file for reading/writing? I've mucked with the select() call, but the call always returns with the value 1. What is an "exceptional condition"? Here's a sketch of what I've attempted (with error checking, etc removed): infile = open ( filename, O_RDONLY ); FD_ZERO ( &fdset ); FD_SET ( infile, &fdset ); for (;;) { result = select ( ulimit(), 0, 0, &fdset, 0 ); printf ("exceptional condition on %s, result = %d\n", filename, result); } BTW, I know about named pipes. I'm interested in regular files. This is on a Sun4, SunOS 4.1.1.. Thanks in advance for any help.. PS: I also tried poll(), with timeout set to -1 and events set to POLLPRI.. Same result. -- Never argue with a fool, people might not know the difference.