comp.lang.ada
 help / color / mirror / Atom feed
From: maa@liacc.up.pt (Mário Amado Alves)
Subject: Creating tempfile takes too long: GNAT or Windows bug?
Date: 9 Oct 2002 04:58:28 -0700
Date: 2002-10-09T11:58:28+00:00	[thread overview]
Message-ID: <4a4de33a.0210090358.fc50c13@posting.google.com> (raw)

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;



             reply	other threads:[~2002-10-09 11:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-09 11:58 Mário Amado Alves [this message]
2002-10-09 14:15 ` Creating tempfile takes too long: GNAT or Windows bug? BREHMER Philippe,
2002-10-09 16:43 ` tmoran
2002-10-09 17:14 ` Warren W. Gay VE3WWG
2002-10-09 18:40   ` Preben Randhol
2002-10-10 12:06     ` Marin David Condic
2002-10-10 12:29       ` Preben Randhol
2002-10-10 17:29         ` Creating tempfile takes too long: GNAT or Windows bug? (& GtkAda) Warren W. Gay VE3WWG
2002-10-10 19:43           ` Stephen Leake
2002-10-11 10:59             ` Preben Randhol
2002-10-11 10:46           ` Preben Randhol
2002-10-14 22:51             ` Warren W. Gay VE3WWG
2002-10-15 10:08               ` Preben Randhol
2002-10-11 12:00           ` Marin David Condic
2002-10-11 11:38         ` Creating tempfile takes too long: GNAT or Windows bug? Marin David Condic
2002-10-11 13:57           ` Preben Randhol
2002-10-12 13:14             ` Marin David Condic
2002-10-12 15:01               ` Preben Randhol
2002-10-10 19:44       ` Jeffrey Carter
2002-10-14 12:42         ` Simon Clubley
2002-10-10 14:02   ` Creating tempfile takes too long: GNAT or Windows bug? Solved Mário Amado Alves
2002-10-09 18:56 ` Creating tempfile takes too long: GNAT or Windows bug? Pascal Obry
2002-10-12  4:45 ` James Ross
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox