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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,17f674692867d416 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!c34g2000yqn.googlegroups.com!not-for-mail From: vlc Newsgroups: comp.lang.ada Subject: Re: Atomic file creation Date: Mon, 4 Jan 2010 06:45:41 -0800 (PST) Organization: http://groups.google.com Message-ID: <9d15c089-a738-47ec-9c48-59a82f560c08@c34g2000yqn.googlegroups.com> References: <4b41fa5f$0$7620$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: 87.221.73.92 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1262616341 17805 127.0.0.1 (4 Jan 2010 14:45:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 4 Jan 2010 14:45:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c34g2000yqn.googlegroups.com; posting-host=87.221.73.92; posting-account=ROuOHgoAAABopjDuvPBd02HgYVR-VCZk User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.6) Gecko/20091215 Ubuntu/9.10 (karmic) Firefox/3.5.6,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:8591 Date: 2010-01-04T06:45:41-08:00 List-Id: On Jan 4, 3:25=A0pm, Georg Bauhaus wrote: > A multitasking program can use a protected object > for this. =A0Have all tasks perform I/O if and only if > it is their turn as decided by the queuing control of > the protected object. The problem is that this file can also be created by other processes, neither written by me nor in Ada. I doubt that I can convince an application that I only have as a binary to respect something like Ada's protected objects ... > Strictly speaking, O_EXCL is not C, but it is provided by Unix's > open(2) call. fopen(3), which is C, does not offer exclusive access > IIRC. That's right. I slowly mix up C with Unix. > The Form string parameter of your Ada implementation might > provide sharing control. =A0The docs will then explain how a > Form value affects files opened by many tasks; possibly even > explain whether the form strings have an effect on using the > external file in other programs. Gnat only supports the SHARED and WCEM form strings, and if I understand the documentation correctly, they have nothing to do with exclusive open. Thanks a lot!