jfielding@xxxxxxxxxxxxxxx wrote:
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.
tmpfile creates a file without a name....
tmpnam generates a name to enable creation of this nameless file.
The case that is now being discussed, the location of a debugging output
file from a dissector, which was /tmp/ethereal.log [and a windows
equivalent]
is something different. The basename of the file must clearly indicate
that it belongs to ethereal and that it is of non-permanent value, so that
a uesr will recognize its purpose and remove it when done.
The directory where it is located should be convenient for a developer
to examine the file. I think /tmp or /var/tmp or %temp% or C:\temp
are OK, but these long names ate too troublesome to navigate.
And convenience for the developer is different than convenience for the
OS...
I think g_get_tmp_dir() is a good place to store this ethereal.log file.
--
Regards,
---------------------------------------------------------------- -o)
Matthijs Melchior Maarssen /\\
mmelchior@xxxxxxxxx Netherlands _\_v
---------------------------------------------------------------- ----