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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6293800221dd683c X-Google-Attributes: gid103376,public From: guerby@gnat.com (Laurent Guerby) Subject: Re: [Q] Ada.Text_IO.Is_Open query Date: 1996/07/06 Message-ID: #1/1 X-Deja-AN: 164127488 sender: guerby@schonberg.cs.nyu.edu references: <836419225.18965.3@assen.demon.co.uk> organization: New York University reply-to: guerby@gnat.com newsgroups: comp.lang.ada Date: 1996-07-06T00:00:00+00:00 List-Id: 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 , Team Ada. "Use the Source, Luke. The Source will be with you, always (GPL)."