how to put a program into a .plan file
Jonathan I. Kamens
jik at athena.mit.edu
Thu Sep 27 06:14:06 AEST 1990
In article <978 at bbt.UUCP>, rgs at bbt.UUCP (steinbeiser) writes:
|> Ok, how do you check the status of the file to see if it has
|> been open by someone else? Its not obvious how (or if) stat() would do this.
|> Also, would the C program have to be running constantly in the background
|> someplace?
1. You open the pipe for write, and do a select() on it, and when you get an
OK to write from select(), you know that someone has opened the other end.
2. Yes, it would have to be running constantly in the background someplace.
I suppose another thing you could do would be to write a program that talks
NFS, and mount it under your home directory (for kernels which support the use
of programs that speak the NFS protocol in this way), and then put a symbolic
link from your .plan into that filesystem -- when something tries to open your
.plan file, your NFS protocol program will get called and you'll be able to
claim whatever you want for the contents of the .plan file.
--
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik at Athena.MIT.EDU Allston, MA 02134
Office: 617-253-8495 Home: 617-782-0710
More information about the Comp.unix.programmer
mailing list