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: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Exclusive file access Date: Tue, 01 Sep 2015 17:17:54 +0200 Organization: JSA Research & Innovation Message-ID: <87d1y22mot.fsf@adaheads.sparre-andersen.dk> References: NNTP-Posting-Host: 109.57.160.99.mobile.3.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: loke.gir.dk 1441120675 9895 109.57.160.99 (1 Sep 2015 15:17:55 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Sep 2015 15:17:55 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Cancel-Lock: sha1:otdyz6GMiOqkE/agWg5/5QaIcBw= Xref: news.eternal-september.org comp.lang.ada:27676 Date: 2015-09-01T17:17:54+02:00 List-Id: 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. On Unix systems you typically see programs creating a separate "lock file" (containing the process ID of the creator) for each locked file. Greetings, Jacob -- "When we cite authors we cite their demonstrations, not their names" -- Pascal