Am 11.10.2013 17:45, schrieb Demitri Muna:
> On Oct 11, 2013, at 3:41 AM, Ole Streicher <
ast...@liska.ath.cx
>> What is the reason to have the same directory structure on Mac and
>> Linux? I guess that a common directory (via NFS or so) between these
>> systems is quite rare, and also a user would expect that a software for
>> Linux would follow the Linux rules (FHS and XDG), and a software for Mac
>> follows its the standards there.
>
> I think part of this comes down to what the user expects. I would
> venture that a large percentage of our users move back and forth between
> Mac OS (or even I suppose a few Windows computers) and Linux
> continuously. We work on our laptops and run code on Linux servers
> (which may or may not be Ubuntu or Debian). It would be a surprise to
> find the .astropy directory different between systems, particularly as
> we are used to the Unix interface on the Mac as being essentially the
> same thing. (Yes, I know it's not the same OS, but to our users it
> effectively is.)
I think it is quite common that different systems -- even Unix like ones
-- differ in their file location. On some systems, python code goes into
/usr/lib/python/, on others it goes into /usr/share/python. Manpages may
be in /usr/man or in /usr/share/man. etc. Global cache may be in
/var/lib, /var/<package>/, or /var/cache/. (What are the according paths
for MacOS here, BTW?)
These different file paths are really a mess. The way to overcome this
mess is to agree on some standardization. For system-wide files, there
is already since long a well-established standard, the Filesystem
Hierarchy Standard (FHS), which today is no longer questioned.
> For better or worse, users are already well familiar with software
> having hidden directories in our home directories: .ssh, .vim, .git,
> .matplotlib, .dropbox, etc. While you can throw this data point away if
> you'd like, I've been a Linux user (though never on my desktop) for many
> years, and I'd never heard of FHS or XDG until this thread. I can assure
> you virtually no astronomer has (and no one on this list counts). I
> understand that it might be the (a) Linux way of doing things, but it's
> not something that exists on the Mac or Windows.
For user files, the history of such a standard is not so long yet. This
leads to the current situation, where each software does has its own
preferences on where to put its data. However, these things are going to
change, and especially for a new piece of software it is wise to follow
the standard and not some old private rules.
> To follow the Mac convention, the proper place for the Astropy cache
> directory components would be:
>
> ~/Library/Application Support/Astropy/
> ~/Library/Preferences/org.astropy.plist
> ~/Library/Caches/org.astropy/
>
> and I wouldn't even think of suggesting that we adopt that, following
> the principle of least surprise. Why? Because Astropy is not a Mac
> application. That's where I expect Mac applications to put things. One
> could argue that the XDG rules apply to specifically Linux applications,
> where astropy is cross-platform.
You have the same problem for almost all larger software packages:
Where, for example would you expect that the Video Lan Client (VLC) puts
its config? On my (Ubuntu) Linux system, it is ~/.config/vlc/, vlc being
cross-platform or not. LibreOffice the same.
*I* would expect that the files are where the standard for the system
puts them. So, I would really use the directories you listed above for
MacOS and the XDG directories for Linux (... and to whatever is the
standard on Windows).
> My question would be: what is the benefit of following the XDG
> suggestion? I'd hate to have all over the documentation, "to see the
> files downloaded, go to ~/.astropy/User_Data, unless you are running
> Ubuntu or Debian, then go to �".
Right. That's why put them always in the system's standard. Fedora may,
BTW go the same way: in the IRAF package preapared for Fedora you will
find the data in XDG_DATA_HOME= ~/.local/share/iraf/ [1]. I will do the
same on Debian/Ubuntu when I get IRAF working :-)
For the benefits: People use more and more software today, and the
software gets more complex. If you just need to learn the XDG paths for
Linux:
* configuration goes into ~/.config/
* data goes into ~/.local/share/
* cache data is in ~/.cache/
(resp. the paths defined by XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME).
you can apply this knowledge to any software you want. You just don't
need to learn a specific rule for astropy, since the rule is the same as
for the other packages. At least, as long as the packages follow these
rules, and that's why it is important that they really do. For older
software, it may take some time to convert them (and their users :-) ),
but I think new software should follow these standards from the beginning.
This is basically the same as for the system-wide files, where there is
no doubt that having common rules is a Good Thing, and one would not
argue to have the same paths on MacOS, Linux, and Windows.
Best regards
Ole
[1]
https://github.com/joequant/iraf/blob/976dbe4b/unix/hlib/mkiraf.csh