How can you tell if a streams file is opened by another process?

How can you tell if a streams file is opened by another process?

Post by Marc Sou » Mon, 04 Dec 1995 04:00:00

Interactive UNIX; a BSD direvitive.
I am trying to write a program that will wake up every once in a while
and look for files to work on.  These files arrive by a copy command
in another process.  I don't have access to the other process, so
there is no interprocess communication possible.  When it sees a file
name that it is waiting for, it opens it and begins work.
Unfortunately, I haven't been able to figure out how to tell if the
file is all there before starting work, or even when I get an eof
condition if that is truely the end of the file or all that has been
copied so far.

Anybody have any ideas.  Thanks.

-marc soule


1. How can a process tell if another process has a file open?

Is there a way to tell if another process has a file open? I'm running two
processes which open the same file (call them process A and process B).
Process A creates the file, writes to it, and closes it. Process B is
monitoring the directory where process A will be creating files. When it
detects a file, it will open it, read and process it, close it, and remove
the file.

My problem is that I have no control over process A. This process is
developed by another organization here at NCR. I can only control
process B. Is there any way that process B can detect if process A (or
any other process) has the file open?

2. Seeking recommendations for multi-port I/O cards.

3. How do I tell what process has a file open?

4. UNIX Versions

5. How to tell which process(es) have a given file/inode open under SVr4?

6. KickStart from Tape?

7. System call tell how many files open in a process

8. SmartCertify's reputation

9. Tell if another process open a file

10. How to tell if their are open file handles when exiting a process?

11. How to tell if a file is open by another process?

12. map a process open file to a open socket ?

13. How to tell which open ports are attached to which processes?