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,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,dc393c3a10696107 X-Google-Attributes: gid103376,public From: Achim Gerhard Subject: Re: Create-Delete tmp Files Date: 2000/03/20 Message-ID: <8b5d8c$cri$1@nnrp1.deja.com>#1/1 X-Deja-AN: 599941412 References: <8at7g0$bhc$1@nnrp1.deja.com> <38D27008.4055C0AB@res.raytheon.com> <8b0pla$aub$1@nnrp1.deja.com> <8b4n77$u4a$1@nnrp1.deja.com> X-Http-Proxy: 1.0 x32.deja.com:80 (Squid/1.1.22) for client 195.243.118.226 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Mon Mar 20 14:40:15 2000 GMT X-MyDeja-Info: XMYDJUIDachim_g Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-03-20T00:00:00+00:00 List-Id: In article , Robert A Duff wrote: > Achim Gerhard writes: > > > The question is: > > is these legal Ada code? > > By the way, "legal" is a compile-time thing in Ada, which isn't what you > mean here. Excuse my bad English. What would you say? > > > loop > > Text_IO.Create ( File => the_file, Mode => Text_IO.OUT_File ); > > Text_IO.Reset ( File => the_file, Mode => Text_IO.IN_File ); > > Text_IO.Delete ( File => the_file ); > > end loop; > > And the question behind that is: > > Why does this code cause the Ada runtime to accumulate memory? > > Because you didn't Close the file. >From LRM, A.8.2 File Management 12 procedure Delete(File : in out File_Type); 13 Deletes the external file associated with the given file. The given file is closed, and the external file ceases to exist. ^^^^^^^^^ 14 The exception Status_Error is propagated if the given file is not open. The exception Use_Error is propagated if deletion of the external file is not supported by the external environment. BTW: I still use Ada83 but that's almost the same in this case Regards Achim > > - Bob > -- _ _ /A/G Sent via Deja.com http://www.deja.com/ Before you buy.