well-known user folders, a proposal

Octavio Alvarez alvarezp at alvarezp.ods.org
Thu Feb 22 12:05:48 PST 2007


On Thu, 22 Feb 2007 09:57:37 -0800, Alexander Larsson <alexl at redhat.com>  
wrote:

> On Thu, 2007-02-22 at 09:50 -0800, Octavio Alvarez wrote:
>> On Thu, 22 Feb 2007 03:11:48 -0800, Alexander Larsson <alexl at redhat.com>
>> wrote:
>>
>> > I've put up a rough version of my approach here:
>> > http://www.gnome.org/~alexl/xdg-user-dirs-0.0.1.tar.gz
>> > (It has no dependencies but libc)
>>
>> Why not just source the config file very early and load the values
>> under C with get_env()? No extra code to handle $HOME and check
>> all other stuff. Less bloat.
>
> Environment variables aren't as stable as files. The environment gets
> modified in many places when forking children, etc.

If you modify the variables explicity, sure, they will, but not otherwise.

> I don't think adding all the dirs to the environment of all desktop
> processes uses less memory than a few shared bytes of code for reading
> the file though, so i don't think its actually less bloat that way.

That optimization should be left to the operating system.

Coding would be easier. You would need to program the same thing on C,
Ruby, Perl, Python, TCL, etc., let aside the toolkit versions for each
language. This is not optimizable by the OS.

> But sure, I guess both ways work about as well. I personally prefer to
> not put a lot of stuff in the environment though.
>
> Also, env vars can't ever change after login.

Why would you need that? I don't imagine a distro upgrade spitting some
directory changes in my face during a critical session (at least not
without my permission).

Sure I would like not to need relogging in just to fix a directory name,
but I should also be able to send a signal to the apps to reload its
values.

-- 
Octavio.



More information about the xdg mailing list