From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: Files opened for exclusive read
Date: Fri, 05 Mar 2004 11:54:59 -0500
Date: 2004-03-05T11:54:59-05:00 [thread overview]
Message-ID: <f5OdnY6vVtp5LdXd4p2dnA@comcast.com> (raw)
In-Reply-To: <686be06c.0403050513.632eb334@posting.google.com>
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
next prev parent reply other threads:[~2004-03-05 16:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-05 13:13 Files opened for exclusive read Daniel Allex
2004-03-05 14:44 ` Preben Randhol
2004-03-05 16:54 ` Robert I. Eachus [this message]
2004-03-05 18:14 ` Preben Randhol
2004-03-05 19:04 ` Mark H Johnson
2004-03-05 19:32 ` Mark H Johnson
2004-03-05 19:52 ` Preben Randhol
2004-03-06 1:05 ` Jeffrey Carter
2004-03-08 3:47 ` Dan Allex
2004-03-16 5:28 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox