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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT 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!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:48:23 -0500 Organization: JSA Research & Innovation Message-ID: References: <1441124612.29807.21.camel@obry.net> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1441140504 19341 24.196.82.226 (1 Sep 2015 20:48:24 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 1 Sep 2015 20:48:24 +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:27684 Date: 2015-09-01T15:48:23-05:00 List-Id: "Pascal Obry" wrote in message news:1441124612.29807.21.camel@obry.net... Le lundi 31 août 2015 à 18:20 -0500, Randy Brukardt a écrit : >> My recollection is that getting Windows to do this requires opening files >> with a particular non-default flag. Probably GNAT does not do that >> (whether >> that is a bug or a feature is not for me to say). > >If my recollection is correct this is undefined by the language, so it >can't be a bug. It can be a bug if GNAT intended to make the Windows sharing flags available via a Form parameter, and just got it wrong somehow. It might be a feature if GNAT's authors were trying to make Windows look like Linux (a serious mistake IMHO, but as you say a legitimate choice vis-a-vis the RM). I would have expected the former since AdaCore doesn't usually make easy things impossible for their customers. They claim (and it is backed up by practice) to be customer-centric. I'd expect that this capability would be available if some GNAT Pro customer had reported the problem, so perhaps it is not as important as it seems. My personal experience is that I use the sharing flags a lot. For instance, for loggers, I usually open the files allowing read sharing (but not write sharing) so that I can read the log file while the service is running. (Exclusive access is exactly that, meaning that you can't even read the log file while it is open, and that can be pain for long-running programs.) For most other sorts of files, exclusive access is best. The Unix strategy of allowing anything is obnoxious. Randy.