Date: Sun, 15 Mar 1998 14:57:52 +0200 (IST) From: Eli Zaretskii To: Vik Heyndrickx cc: Charles Sandmann , djgpp-workers AT delorie DOT com Subject: Re: Temporary files considered unsafe In-Reply-To: <3508E9EA.37D9@rug.ac.be> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.