comp.lang.ada
 help / color / mirror / Atom feed
From: guerby@gnat.com (Laurent Guerby)
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: <ws9g274rfuw.fsf@schonberg.cs.nyu.edu> (raw)
In-Reply-To: 836419225.18965.3@assen.demon.co.uk


John> If I have defined an object of Ada.Text_IO.File_Type, say
John> My_File, I can use Ada.Text_IO.Is_Open to find out whether
John> My_File is associated with a physical file.

John> However, if I have a string say "autoexec.bat", is there a
John> function that will tell me if I have a file already open of that
John> name (i.e. if the physical file is associated with an object of
John> type Ada.Text_IO.File_Type - effectively the opposite of what
John> Ada.Text_IO.Is_Open does)?

   Assuming that you have a way to step through all your application
objects of type File_Type, you can get the name of the associated
physical file for each one using the function Ada.Text_IO.Name which
returns a string that "may be used in an open Operation",
RM95-A.8.2(21), so you should get the full name (with complete
path). You may need a bit of file name processing to be able to
compare with "autoexec.bat". 

   Hope this helps,

-- 
Laurent Guerby <guerby@gnat.com>, Team Ada.
   "Use the Source, Luke. The Source will be with you, always (GPL)."




  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 [this message]
1996-07-06  0:00 ` John Herro
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox