From: johnherro@aol.com (John Herro)
Subject: Re: [Q] Ada.Text_IO.Is_Open query
Date: 1996/07/06
Date: 1996-07-06T00:00:00+00:00 [thread overview]
Message-ID: <4rm5el$t14@newsbf02.news.aol.com> (raw)
In-Reply-To: 836419225.18965.3@assen.demon.co.uk
john@assen.demon.co.uk (John McCabe) writes:
> If I have a string say "autoexec.bat", is there a function that
> will tell me if I have a file already open of that name ...
> effectively the opposite of what Ada.Text_IO.Is_Open does?
Dear John,
I don't know of such a function, but I can suggest the following.
Instead of calling Ada.Text_IO.Create and Ada.Text_IO.Open directly, call
procedures that you write. Your procedures should first store the file
name, say in a linked list of unbounded strings, and then call
Ada.Text_IO.Create or Ada.Text_IO.Open. Then write a function to see if a
given string is in the linked list. (You'll also need a procedure to call
in place of Ada.Text_IO.Close. Your procedure should call
Ada.Text_IO.Name to get the file name, remove the string from the linked
list, and then call Ada.Text_IO.Close.)
This isn't exactly what you asked for, but it doesn't sound like much
work.
I know from reading c.l.a. that you're a very advanced Ada person, so
please forgive me if you thought of this already, and were asking only in
the hope of finding a simpler answer.
- John Herro
Software Innovations Technology
http://members.aol.com/AdaTutor
ftp://members.aol.com/AdaTutor
prev parent reply other threads:[~1996-07-06 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-07-03 0:00 [Q] Ada.Text_IO.Is_Open query John McCabe
1996-07-06 0:00 ` Laurent Guerby
1996-07-06 0:00 ` John Herro [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox