Subject: Location of Megatools INI Config File
From: A. S.
Date: Mon, 8 Jun 2020 01:51:38 +0530
Hello Ondrej,

Currently as per the docs the mega.ini config file is read either from the
current directory or the user's home directory (except when
--ignore-config-file is specified, or when an explicit path to the config
file is given via --config <path>).

First, what is considered the "home directory" under Windows?

Second, I am calling megatools from multiple batch files. The EXE itself as
well as the mega.ini file is stored in a fixed dir (D:\Megatools), and I
create batch files in different locations to download different types of
files. Typically my batch files look like this:

@set path=%path%;D:\Megatools
megatools dl https://mega.nz/file/...
megatools dl https://mega.nz/file/...

Now suppose for example that a batch file like this is stored in and
executed from E:\Downloads\Videos, unfortunately megatools doesn't read the
mega.ini config file since neither does it exist in the current directory,
nor in the "home directory" (whatever that is), nor has --config <path>
been specified.

I would like to have the config file read without making every megatools
call in the batch file look like the following:

megatools dl --config "D:\Megatools" https://mega.nz/file/...

So my request is, would it be possible to make megatools by default also
look for its config file in the dir where its EXE is stored?

Last but not least, since different mega.ini files may be stored in the
current dir and home dir (and if you fulfil my request, the EXE's dir
also), it would be nice if the tool initially printed out something like
"Loaded config file <full path to mega.ini>" so that there's no confusion
about which config file has been read.

Thanks and Regards,

Andrew