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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!.POSTED!not-for-mail From: =?UTF-8?B?QmrDtnJuIEx1bmRpbg==?= Newsgroups: comp.lang.ada Subject: Re: Exclusive file access Date: Thu, 27 Aug 2015 16:42:02 +0200 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 27 Aug 2015 14:40:19 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="974b710e4ae21effefb2e992825f4591"; logging-data="7370"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/KyK9gB4iA3lvfUdolGUpy" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 In-Reply-To: Cancel-Lock: sha1:SY7YCE67h5b8ZAvCEFO3bVf8bdU= Xref: news.eternal-september.org comp.lang.ada:27619 Date: 2015-08-27T16:42:02+02:00 List-Id: On 2015-08-27 15:52, ahlan@marriott.org wrote: > Obviously I'm misunderstanding something here. I'm not sure you do. On Linux, I start daemons and the open/lock a named file. if I try to start the daemon again, the locking part will fail and the second instance will exit. But I could not solve it in pure Ada. The Gnat.lockfile package leaves the file if daemon is killed, so no go using gnat-solution. I created a small posix package and used function lockf. But how to do it on XP, I do not know -- Björn