Ethereal-users: Re: [Ethereal-users] change location of preferences dir '.ethereal' on W2K
On Thu, Aug 30, 2001 at 01:02:14AM -0700, Guy Harris wrote:
> So which of those, in a shiny modern 32-bit application, *should* the
> application treat as the user's "home directory"?
Well, after digging through some stuff in the W2K help files and various
Web pages, it appears that:
your "user profile" is where settings should be stored (as the
W2K default name for the directory under which profile
directories are placed, "Documents and Settings", suggests);
your "home directory", if it exists, is a place, probably on a
file server, where you can store stuff;
you can also store stuff in your user profile directory, e.g.
under "My Documents" in W2K, but that's not likely to be on a
file server, although with "roaming profiles" stuff it can be
copied *from* a file server to your local machine on login and
copied *back* (or, at least, the changed stuff copied back,
except for stuff in the "Local Settings" subdirectory, which is
for stuff that shouldn't be copied back) on logout - I assume
the idea is that "disconnected operation" should be supported,
i.e. you may not be able to get at your home directory if the
server is down, but you can at least get at your desktop and the
like.
The "get_home_dir()" routine in Ethereal is used to find the location of
the ".ethereal" directory, under which are stored:
the "preferences" file;
plugins;
your personal "ethers" and "ipxnets" files;
color filters (filter expression/color pairs);
saved display and capture filters;
and is also used to find the GTK RC file for Ethereal.
I'd consider most if not all of those to be "settings", so, on systems
where you can find out where the user profile is, I'd suggest putting
the ".ethereal" directory in the user profile directory rather than in
the home directory.
I.e., if the USERPROFILE environment variable is set, treat its value as
the "home directory" in the UNIX sense. (UNIX systems use the "home
directory" as the place for personal settings and all personal files,
rather than splitting it into a "user profile" directory for personal
settings and some personal files and a "home directory" that might store
other personal files.)
USERPROFILE is set on NT 4.0 and NT 5.0^H^H^H^H^H^HW2K, and it's
probably set on NT 5.1^H^H^H^H^H^HWhistler^H^H^H^H^H^H^H^HWindows XP as
well.
I can't speak for Windows OT - Windows 95, Windows 98, and Windows ME -
however; the Windows partition on my home machine runs NT 4.0, and my
office machine runs W2K. I don't know whether it has a "user profile"
notion that includes a full-blown directory under which the desktop
resides, for example.
If USERPROFILE isn't set - on, say, Windows OT - we might just use
"C:\".
Unless somebody can suggest why it's a good idea to put the ".ethereal"
directory under the directory constructed from HOMEDRIVE and HOMEPATH
(other than "well, that's called the 'home directory' on Windows, and we
put '.ethereal' under the home directory on UNIX, so...), I'll probably
make "get_home_dir()" use "USERPROFILE" if it's set.