Hello Jens,
On 10 Apr 2002 at 12:31, Jens Rösner wrote:

> > > wgetrc works fine under windows (always has)
> > > however, .wgetrc is not possible, but 
> > > maybe . does mean "in root dir" under Unix?
> > 
> > The code does different stuff for Windows. Instead of looking for
> > '.wgetrc' in the user's home directory, it looks for a file called
> > 'wget.ini' in the directory that contains the executable. This does
> > not seemed to be mentioned anywhere in the documentation.
> >
> From my own experience, you are right concerning the location wget searches
> for wgetrc on Windows.
> However, a file called "wgetrc" is sufficient.

There are two wgetrc files it may use, a "system" wgetrc and a
"user" wgetrc. For Windows, this distinction is somewhat obscured,
as it does not use a concept of user home directory (it could be
made to do so on some versions of Windows, but it doesn't at the
moment).

The "system" wgetrc file is only used if support for this has been
conditionally compiled into the program (a preprocessor macro
called SYSTEM_WGETRC should be defined if support is required and
the value of the macro is the name of the actual wgetrc file to
look for). For Windows, the SYSTEM_WGETRC macro is set to "wgetrc",
which means that Wget will look for a system wgetrc file called
wgetrc in the current working directory when it starts.

You mentioned I was right about the location of the file, but this
should not be the case for the file called "wgetrc" - it should be
looking for this in the current directory, not the directory
containing the executable (unless these are the same!). I don't
think it makes sense for a "system" wgetrc file to be in the
current directory, but that is what it does!

Also note that Wget supports Microsoft, Borland and Watcom C
compilers, all with different makefiles, but support for the
"system" wgetrc file is only currently included in the makefile
for the Microsoft compiler.

> In fact, wgetrc.ini will not be found and thus 
> its options ignored.

The file is called wget.ini (not wgetrc.ini) and this is what Wget
uses as the "user" wgetrc for the Windows versions, even though it
looks for it in the directory containing the wget.exe program, so
is not really user specific (however, the user can override it by
setting the WGETRC environment variable to point to a different
wgetrc file).

Looking at the comments in the source code it looks as if this
"wget.ini" file in the directory containing wget.exe is supposed to
be the only file that Wget reads for Windows. The comment in the
source code (src/init.c) says "SYSTEM_WGETRC should not be defined
under WINDOWS", even though it is defined in current builds, at
least with when building with the Microsoft compiler.

To sum up what the current Windows version does:

* If built with the Microsoft compiler, looks for a file named
  "wgetrc" in the current directory and reads the file if it is
  present.
* If "WGETRC" environment variable is set, reads the file named by
  the environment variable (errors out if not there); otherwise
  looks for a "wget.ini" file in the directory containing the
  wget.exe program being run and reads the file if it is present.

The above information was gleaned from examination of the source, rather from 
actually running the program! Does yours do something
different?

Reply via email to