nano-devel
[Top][All Lists]
Advanced

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

Re: [Nano-devel] Unable to create state directory


From: Brand Huntsman
Subject: Re: [Nano-devel] Unable to create state directory
Date: Sun, 19 Nov 2017 03:37:56 -0700

On Sun, 19 Nov 2017 10:20:25 +0100
Benno Schulenberg <address@hidden> wrote:

> Hm.  I don't like it.  In the spec [1] it says that it must create
> the destination directory (when attempting to write a file, not when
> attempting to read one) when it does not exist, it does not say that
> it should create any parent directories too.  Of course, one might
> argue that that is implied, but... I would choose to just silently
> skip reading/writing state when the XDG_DATA_* directory does not
> exist.

Silently as in removing the error message? Histories would be disabled and the 
user has no idea why or what to do. That is worse than currently telling the 
user to create nano's default config directory.

It could print the error if XDG_DATA_HOME is set and doesn't exist. If 
XDG_DATA_HOME isn't set, don't create any directory or print an error but do 
set the history filenames and return true. Before saving, it should always 
check if statedir exists and create it if not.

It should probably even do this if XDG_DATA_HOME is set and doesn't exist, a 
system might set a non-standard path for all users. Putting empty directories 
in /etc/skel/ litters homes with directories that might never be used. That 
would be a valid reason for XDG_DATA_HOME not existing and nano should handle 
it.




reply via email to

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