Ethereal-dev: Re: [Ethereal-dev] Directory settings

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

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Sun, 29 Feb 2004 21:43:02 +0100
Guy Harris wrote:

On Sun, Feb 29, 2004 at 07:57:21PM +0100, Ulf Lamping wrote:
I currently find it very unintuitive, where Ethereal finds / uses all it's directories. There is also no way to get information, what the current settings are.


Example: When I start a capture with the filename "hello.cap", I'm not sure where the file will be placed into and "of course" there's no way to change this :-(

Some places comes to my mind:

- working dir (this is the dir where "hello.cap" would be saved)

The working directory starts out as the directory in which Ethereal is
running.

If Ethereal is run from the command line, it'll run in that directory.

It appears that at least some UNIX desktops run Ethereal from your home
directory if you run it from a desktop/panel icon or a menu item.

If you run it from a desktop shortcut on Windows, and the desktop
shortcut has a "run it from this directory" setting, it'll be run from
that directory; I don't know what directory it's run in if that setting
is absent.  (I can try it on NT 4.0 at some point.)

The NSIS installer, unfortunately, doesn't appear to have a way not to
specify a "run it from this directory" setting in the shortcut it
creates; I recently changed ethereal.nsi to make a SetOutPath call to
set it to $PROFILE, which causes the user's "profile directory" to be
the "run it from this directory" setting - that directory is the
equivalent of the home directory on UNIX.

I'm not sure if that's the right thing to do. The data in the profile directory on win32 will be copied to the server each time
you do a logoff, so this will copy probably a huge amount of data.

Also some people reported, that the working dir must be the same as the exe's dir, to work together with GTK-Wimp,
however, I didn't tested this myself.

- program dir (where the .exe is, or how it's called under unix)

I'm not sure it has an equivalent name on UNIX, but it's usually
something such as "/usr/bin" or "/usr/X11R6/bin" or "/usr/local/bin".

On UNIX, typically there's a top-level directory under which various
installation subdirectories exist, e.g. "/usr" if the executable is
installed in "/usr/bin" or "/usr/local" if it's installed in
"/usr/local/bin".

- plugins dir (where the plugins will be searched for, includes version string)

There are two plugin directories - the global one, and the per-user one.

The global one:

	it's just a subdirectory of the program directory on Windows -
	it's the "plugins\{plugin API version}" subdirectory, where
	"plugin API version" is currently the version number of
	Ethereal;

	on UNIX, if the top-level installation directory is X, it's the
	"X/lib/ethereal/plugins/{plugin API version}" directory.

The per-user one is just the "plugins" subdirectory if your personal
configuration directory.

- persconf dir (where the personal config files will be placed, e.g. personal colorfilters)

On UNIX, that's the ".ethereal" subdirectory of your home directory;
that follows a common UNIX convention.

On Windows, it's the "Ethereal" subdirectory of:

	the directory specified by the "APPDATA" environment variable,
	if that's set (on English-language Windows, that's probably
	something such as "C:\Documents and Settings\{user
	name}\Application Data");

	otherwise, the "Application Data" subdirectory of the directory
	specified by the "USERPROFILE" environment variable;

	otherwise, "C:\".

That's what some specification from Microsoft says (well, modulo the
fact that the path is supposed to be something such as "{vendor
name}\{application name}", or something such as that, but there's no
"Etherealcorp" (well, there's now an "Ethereal, Inc." that owns the
trademark on the Ethereal logo, but that's somewhat redundant -
"Ethereal\Ethereal" would be somewhat pointless).

"USERPROFILE" is, at least on NT (including NT 5.x, e.g. W2K, WXP, W2K3
Server), the user's "profile directory", which is typically

	x:\WINNT\Profiles\{user login name}

on NT 4.0, where "x:" is your root drive, and typically

	x:\Documents and Settings\{user login name}

on NT 5.0 (W2K, WXP, W2K3).

- globalconf dir (where the global config files will be placed, e.g. global colorfilters)

On UNIX, that's typically the "share/ethereal" subdirectory of the
top-level installation directory.

On Windows, that's the directory in which the Ethereal executable
resides.

- tmp dir (where an "unamed" new capture file will be placed)

If the TMPDIR environment variable is set, that's what's used.

Otherwise, on Windows, if the TEMP environment varible is set, that's
what's used.

Otherwise, if P_tmpdir is defined at compile time, that's what's used;

Otherwise, "/var/tmp" is used.  (The assumption here is presumably that
TEMP is always set on Windows, typically to C:\TEMP or something such as
that).

- file open dir (pref setting already available)

Just for a first start, I wanted to get a list of the possible dirs, some of them might be duplicates.
Do I miss something?

IMHO we need a new page "Directories" somewhere in Edit/Preferences...
Most of the dirs are output only, some might be a new preference setting.

What do "the list" think?

I don't think having a preference setting specifying where the personal
preference settings are stored is likely to be useful.  :-) Besides,
that directory follows UNIX and Windows conventions.  The personal
plugins directory is just a subdirectory of that directory.

The program directory, plugins directory, and global configuration files
directory are all related, both on UNIX and Windows; they're all set at
installation time on Windows, and typically at build time on UNIX.  I
don't see any need to make them a configuration preference; anybody
who's going to be making *global* changes to Ethereal needs to know
where it's installed and can presumably figure out where it's installed.
Agreed. I didn't think of making this to preference settings, but to find a place where to give this "read only" information to the user.

The directory where the "Save As..." dialog box starts when saving a
capture file should perhaps be the file open directory - and the file
open directory should change if the user saves to some different
directory.  I suspect that's how it works with most other applications
on various GUIs.

I tend to agree with that, but this has to be investigated a bit further.


Hmmm, I've printed this mail for further reference, as you won't find this information anywhere else in the documentation ;-)


However....
I would like to start getting all the dirs where things are used from and putting into. I don't think all of these dir's have to be preference settings, as lot's of them related to each other.

Maybe it's a good way to start with *showing* all the dirs to the user as "read-only",
as this will be much easier to discuss about :-)

When we have a complete list of the dirs used, we have a good starting point to decide,
which of them should be preference settings and how they should behave
and which are only derived dirs and should be read-only (like the plugin dirs).

Regards, ULFL