From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Exclusive file access Date: Tue, 1 Sep 2015 15:37:55 -0500 Organization: JSA Research & Innovation Message-ID: References: <87d1y22mot.fsf@adaheads.sparre-andersen.dk> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1441139876 19071 24.196.82.226 (1 Sep 2015 20:37:56 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Sep 2015 20:37:56 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:27683 Date: 2015-09-01T15:37:55-05:00 List-Id: "Jacob Sparre Andersen" wrote in message news:87d1y22mot.fsf@adaheads.sparre-andersen.dk... > Ahlan Marriott wrote: > >> I am not trying to protect the file from other tasks I am trying to >> protect the file from other processes - ie other programs or utilities >> - perhaps executing on other computers if the file in question is on a >> network. I want to open the file in such a way that I am granted >> exclusive write access. > > I'm not even sure all operating systems support this. Most don't. That's why it's implementation-defined, and you're SOL if your implementation doesn't properly implement the Windows sharing flags (which have no Unix counterpart). Randy.