Ethereal-dev: Re: [Ethereal-dev] [Patch] asn1 plugin

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Mon, 3 Nov 2003 14:41:27 +0000

Guy Harris <guy@xxxxxxxxxxxx> on Mon, 3 Nov 2003 02:34:03 -0800 wrote:

>NT 5.x has a per-user tempfile directory, as I remember,
Yes.
> and perhaps some of them lack the global c:\temp directory.
Many of them. The global directory is often c:\windows\temp or similar.
>Perhaps "get_tempfile_path()" should default to "c:\temp" if it exists, and "c:\" if it doesn't.
NO no no. There's no guarantee that c: exists or has enough space.

Look for environment variable TEMP or TMP. I think TEMP always exists, most systems have TMP as well. They both point to the same place on my machines:

Win2k:        D:\DOCUME~1\username\LOCALS~1\Temp
WinNT:        E:\TEMP
Win95:        C:\WINDOWS\TEMP

There's probably a more general solution. Look at FILE *tmpfile(void) and char *tmpnam(char *s) in stdio.h.

Julian.