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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ed7075f5ab49c273 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-03-05 08:55:01 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!cyclone.swbell.net!cyclone-sf.pbi.net!216.196.106.144!border2.nntp.sjc.giganews.com!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Fri, 05 Mar 2004 10:55:00 -0600 Date: Fri, 05 Mar 2004 11:54:59 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Files opened for exclusive read References: <686be06c.0403050513.632eb334@posting.google.com> In-Reply-To: <686be06c.0403050513.632eb334@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.77.160 X-Trace: sv3-rolVkn3N5f4ikDPbxSZBB5Iv7XbdEeJwd8y9hFGgrNjvJ3vFObw4hYzggyIqX6lnfRBSz9Y91BF90/2!3jzfTfUrD2LK8/kVBG8dYz4YiY+Y2Epz1NLx4W0HvMXYyJ69tOGCHfIk1lCjHw== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:6086 Date: 2004-03-05T11:54:59-05:00 List-Id: Daniel Allex wrote: > When Ada opens a file, the only option is for exclusive use. This > causes a problem when multiple executables may be reading at the same > time. Any suggestions? Look into mode strings for your compiler. When you open a file in Text_IO there is a mode parameter. The meaning of the mode parameter is implementation defined. Of course, the possible settings using the mode string will depend on the operating system as well, and Windows does not 'simply' support file sharing. In GNAT 3.15p a mode string of "shared=yes" will allow you to share a file within an Ada program (have it open under two different names with different positions). But if you want to share a file with say an external C program, you probably have to use Interfaces.C_Strings. The problem of course is the buffering that otherwise goes on. Read the gnat_rm for much more detail. -- Robert I. Eachus "The only thing necessary for the triumph of evil is for good men to do nothing." --Edmund Burke