wget-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Wget-dev] wget2 | Follow XDG Base Directory Specification (!415)


From: Darshit Shah
Subject: Re: [Wget-dev] wget2 | Follow XDG Base Directory Specification (!415)
Date: Sun, 17 Feb 2019 23:39:37 +0000

Darshit Shah commented on a discussion on src/options.c:

> +     if (data_home)
> +             return data_home;
> +
> +#ifdef _WIN32
> +     if ((env = getenv("LOCALAPPDATA")) && *env)
> +             data_home = wget_aprintf("%s/wget", env);
> +     else
> +             data_home = wget_strdup(user_home);
> +#else
> +     if ((env = getenv("XDG_DATA_HOME")) && *env)
> +             data_home = wget_aprintf("%s/wget", env);
> +     else {
> +             data_home = wget_aprintf("%s/.local/share/wget", user_home);
> +     }
> +#endif
> +     mkdir_path(data_home, false);

Uhh. I think you're confusing between the two directories. There's the 
`$XDG_CONFIG_HOME/wget` directory which houses the `wget2rc` file. This 
directory needs to be created by the user since by default Wget / Wget2 has no 
user configuration file installed. So, they follow the documentation and make 
the file in the right location.

Then, there is, `$XDG_DATA_HOME/wget`, which is where Wget stores its state 
information. This includes the TLS Session files, HSTS lists, HPKP, etc. Since, 
these files are stored without user intervention, it makes sense that Wget 
creates the required directory structure automatically. And the structure 
chosen here isn't arbitrary, it's the one defined by the XDG Desktop 
Specification, which means, that the `~/.local/share` directory will be used by 
many other applications as well. There's a good chance, Wget2 won't be the one 
creating it.

-- 
Reply to this email directly or view it on GitLab: 
https://gitlab.com/gnuwget/wget2/merge_requests/415#note_142125791
You're receiving this email because of your account on gitlab.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]