delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/15/08:00:25

Date: Sun, 15 Mar 1998 14:57:52 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
cc: Charles Sandmann <sandmann AT clio DOT rice DOT edu>, djgpp-workers AT delorie DOT com
Subject: Re: Temporary files considered unsafe
In-Reply-To: <3508E9EA.37D9@rug.ac.be>
Message-ID: <Pine.SUN.3.91.980315145729.9708B-100000@is>
MIME-Version: 1.0

On Fri, 13 Mar 1998, Vik Heyndrickx wrote:

> For the clock value therefore the highest resolution is needed and this
> means that we need to read the PIT-timer0 directly, and I don't know
> whether that is such a good idea (although the port address is extremily
> standard, some flavours of DOS that run more or less as part of a
> protected OS (DosEMU?, NT?, 95?, OS/2?) may like it less that we do
> that). And this is the only method to get so precise, since RDTSC is not
> supported by 386's, most 486's and some 586's.

This discussion has drifted a lot.  Let me remind that it started when
Vik was suggesting a better way of generating names for temporary
files.  Plunging into the PIT counter, Windows incompatibilities and
related arcana is a far cry from that.

IMHO, it makes sense to switch to using something like a PID for this
job only if it allows to generate a unique name and avoid pounding the
disk to see whether a file by that name already exists.  If we still
need to check the filesystem, then the existing code in `tmpnam' is
good enough: after all, the chances for the first generated name to
fail the uniqueness test are very small, even on Windows.

Making our `getpid' function better in Windows is another matter, well
worth pursuing (IMHO).  But the considerations for a good PID are
slightly different.

So I suggest to decide whether this discussion is useful for the
temporary files, or can we close this issue and talk about PID alone.

My opinion at this point is that we could not find a way to generate
unique names for temporary files which is significantly better than
the existing one.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019