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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,41b2c090403fab50,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-09 04:58:28 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: maa@liacc.up.pt (=?ISO-8859-1?Q?M=E1rio_Amado_Alves?=) Newsgroups: comp.lang.ada Subject: Creating tempfile takes too long: GNAT or Windows bug? Date: 9 Oct 2002 04:58:28 -0700 Organization: http://groups.google.com/ Message-ID: <4a4de33a.0210090358.fc50c13@posting.google.com> NNTP-Posting-Host: 193.137.36.168 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1034164708 1602 127.0.0.1 (9 Oct 2002 11:58:28 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 9 Oct 2002 11:58:28 GMT Xref: archiver1.google.com comp.lang.ada:29611 Date: 2002-10-09T11:58:28+00:00 List-Id: Hi all. Creating a temporary file (see test code below) is taking the unreasonable time of 30+ seconds on Windows XP (with GNAT 3.14p) on my laptop. Has someone had this sort of problem? On Linux (same compiler version), in another machine, it takes a reasonable time: 0.0004 seconds. On Linux the compiler warns: "/usr/gnat/lib/gcc-lib/i686-pc-linux-gnu/2.8.1/adalib/libgnat.a(a-adaint.o): In function `__gnat_tmp_name': a-adaint.o(.text+0x504): the use of `tmpnam' is dangerous, better use `mkstemp'" which sounds like something related to the issue--but there is no issue on Linux. On Windows it does not emit this warning--but the problem manifests itself! Painfully! Thanks a lot, --MAA --------------- -- test code -- --------------- with Ada.Direct_IO; with Ada.Text_IO; use Ada.Text_IO; with Ada.Calendar; use Ada.Calendar; procedure Test_File is package Character_IO is new Ada.Direct_IO (Character); use Character_IO; Tempfile : Character_IO.File_Type; T_Start, T_End : Time; begin T_Start := Clock; Create (File => Tempfile, Mode => Inout_File); T_End := Clock; Put_Line ("Tempfile took" & Duration'Image (T_End - T_Start) & " seconds to create!"); end;