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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID 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: johnherro@aol.com (John Herro) Subject: Re: [Q] Ada.Text_IO.Is_Open query Date: 1996/07/06 Message-ID: <4rm5el$t14@newsbf02.news.aol.com>#1/1 X-Deja-AN: 164024877 sender: root@newsbf02.news.aol.com references: <836419225.18965.3@assen.demon.co.uk> organization: America Online, Inc. (1-800-827-6364) newsgroups: comp.lang.ada Date: 1996-07-06T00:00:00+00:00 List-Id: 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