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 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: John J Cupak Jr Subject: Re: Create-Delete tmp Files Date: 2000/03/17 Message-ID: <38D27008.4055C0AB@res.raytheon.com>#1/1 X-Deja-AN: 598837523 References: <8at7g0$bhc$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: multipart/mixed; boundary="------------FBEC8008D2C49F913E33A8F2" X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 953315348 138.127.184.129 (Fri, 17 Mar 2000 12:49:08 EST) Organization: Raytheon Company MIME-Version: 1.0 NNTP-Posting-Date: Fri, 17 Mar 2000 12:49:08 EST Newsgroups: comp.lang.ada Date: 2000-03-17T00:00:00+00:00 List-Id: This is a multi-part message in MIME format. --------------FBEC8008D2C49F913E33A8F2 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Achim, If you create a file without specifying the name, Ada is supposed to create a temporary file which is "automagically" deleted on close. You shouldn't need the Delete call. Hope this helps. John Achim Gerhard wrote: > Hi all, > is this legal Ada code? > 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; > The background is: > in an application I use a temporary file. First i create a (noname) file > and write some stuff into that file. After that, I want to read that > stuff. So, I'll open that file as In_File and read from the beginning > (reset...). > Finally I throw away that file (delete). > The main things Create/Reset/Delete are written in the code fragment > above. > I don't see anything illegal in this code, but the Ada runtime seems to > accumulate memory (for file handles?) until ... it throws in the towel. > Any comments? > Hope this will not lead into a discussion 'how2use tmp files' :-) > Regards, > Achim > -- > _ _ > /A/G > > Sent via Deja.com http://www.deja.com/ > Before you buy. --------------FBEC8008D2C49F913E33A8F2 Content-Type: text/x-vcard; charset=us-ascii; name="John_J_Cupak.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for John J Cupak Jr Content-Disposition: attachment; filename="John_J_Cupak.vcf" begin:vcard n:Cupak Jr;John J tel;fax:978.858.4336 tel;work:978.858.1222 x-mozilla-html:TRUE org:Raytheon Company;Northeast Software Training version:2.1 email;internet:John_J_Cupak@res.raytheon.com title:Software Engineering Instructor adr;quoted-printable:;;50 Apple Hill Road=0D=0AT3MN35;Tewksbury;MA;01876;USA x-mozilla-cpt:;9904 fn:John J Cupak Jr end:vcard --------------FBEC8008D2C49F913E33A8F2--