Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!ames!bionet!apple!longway!std-unix From: donn@hpfcdc.HP.COM (Donn Terry) Newsgroups: comp.std.unix Subject: Re: Another file handles question/comment Message-ID: <380@longway.TIC.COM> Date: 27 Aug 89 19:06:32 GMT References: <378@longway.TIC.COM> Sender: std-unix@longway.TIC.COM Reply-To: donn@hpfcdc.HP.COM (Donn Terry) Organization: HP Ft. Collins, Co. Lines: 32 Approved: jsq@longway.tic.com (Moderator, John S. Quarterman) From: donn@hpfcdc.HP.COM (Donn Terry) To answer Barry Traylor's questions simply: The onus is on BOTH the implementation and the application. First, remember that in this case "application" and "process" are disctinct things. In particular, an application can consist of several processes, not all of which were written by the application writer (e.g., system utilities such as grep). The *application* is constrained so that to conform to POSIX only one file handle for a file is in use at a time, across ALL processes in the application, and that hand-off of file handles be done as required. The *implementation* is constrained so that if the application follows this rule, it will in fact work. (Note that pre-POSIX implementations didn't do enough so that the application had a chance at all of making it work.) I think that some of the confusion comes from trying to make it exclusively one or the other's total responsibility. In the rationale it says that the rules are stated so that the application has "a fighting chance" of doing this, not that it will work in every possible combination. If this doesn't help then let's (on the net) look at it in more detail. Donn Terry (not speaking in any 'official' way) Volume-Number: Volume 17, Number 11