Difference between revisions of "Directory Standards"

From GnuCash
Jump to: navigation, search
(a short overview of standards for directories.)
 
(Unix based: several minor improvements)
Line 1: Line 1:
 
This is a short overview of standards for directories.
 
This is a short overview of standards for directories.
 
==Unix based==
 
==Unix based==
 +
There are 2 important standards, which have their own scope:
 +
 
===FHS===
 
===FHS===
The [https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] (FHS) defines the general directory layout of a ''system''. It is currently maintained by [https://wiki.linuxfoundation.org/ The Linux Foundation] at https://wiki.linuxfoundation.org/lsb/fhs. Before it was at http://www.pathname.com/fhs/ maintained by  the ''Linux Standard Base'' (LSB) workgroup of freestandards.org.
+
The [https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Filesystem Hierarchy Standard] (FHS) defines the general directory layout of a '''computer system'''. It is currently maintained by [https://wiki.linuxfoundation.org/ The Linux Foundation] at https://wiki.linuxfoundation.org/lsb/fhs. Before it was at http://www.pathname.com/fhs/ maintained by  the ''Linux Standard Base'' (LSB) workgroup of freestandards.org.
 
The different BSD variants are no longer part. They use only <Syntaxhighlight lang="sh">man hier(7)</Syntaxhighlight>.
 
The different BSD variants are no longer part. They use only <Syntaxhighlight lang="sh">man hier(7)</Syntaxhighlight>.
 +
 
===XDG===
 
===XDG===
Freedesktop.org's https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html defines some rules for the ''home'' directory.
+
The former '''X Desktop Group''' is today known as [https://www.freedesktop.org Freedesktop.org]. Its [https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html XDG Base Directory Specification] defines some rules for the '''home directory'''.
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
Line 11: Line 14:
 
! scope="col"| Default
 
! scope="col"| Default
 
! scope="col"| Notes
 
! scope="col"| Notes
 +
 +
|- style="vertical-align:top;"
 +
| $XDG_CONFIG_HOME
 +
| $HOME/.config
 +
| the base directory relative to which ''user specific configuration'' files should be stored.
 +
 +
|- style="vertical-align:top;"
 +
| $XDG_CONFIG_DIRS
 +
| /etc/xdg
 +
| the colon ':' seperated preference-ordered set of base directories to search for configuration files ''in addition to $XDG_CONFIG_HOME''
  
 
|- style="vertical-align:top;"
 
|- style="vertical-align:top;"
Line 21: Line 34:
 
| usr/local/share/:/usr/share/
 
| usr/local/share/:/usr/share/
 
| the colon ':' seperated  preference-ordered set of base directories to search for data files ''in addition to $XDG_DATA_HOME''
 
| the colon ':' seperated  preference-ordered set of base directories to search for data files ''in addition to $XDG_DATA_HOME''
 
|- style="vertical-align:top;"
 
| $XDG_CONFIG_HOME
 
| $HOME/.config
 
| the base directory relative to which ''user specific configuration'' files should be stored.
 
 
|- style="vertical-align:top;"
 
| $XDG_CONFIG_DIRS
 
| /etc/xdg
 
| the colon ':' seperated preference-ordered set of base directories to search for configuration files ''in addition to $XDG_CONFIG_HOME''
 
  
 
|- style="vertical-align:top;"
 
|- style="vertical-align:top;"
Line 42: Line 45:
 
| Applications should use this directory for ''communication and synchronization'' purposes and should not place larger files in it, since it might reside in runtime memory and cannot necessarily be swapped out to disk...
 
| Applications should use this directory for ''communication and synchronization'' purposes and should not place larger files in it, since it might reside in runtime memory and cannot necessarily be swapped out to disk...
 
|}
 
|}
 +
Partly the home directory uses similar subdirectories as the system has, some with the same name like <code>/usr/share</code> vs. <code>~/.share</code>, others with a different name like <code>/etc</code> vs. <code>~/.config</code>. This will allow among others a ''fallback'': if no value is found in <tt>~/.config</tt> check <tt>/etc</tt> for the system wide default.
  
 
==MS-DOS based==
 
==MS-DOS based==
 
The [https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx KNOWNFOLDERID]s replaced in ''Vista'' the former [https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx constant special item ID list] (CSIDL).
 
The [https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx KNOWNFOLDERID]s replaced in ''Vista'' the former [https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx constant special item ID list] (CSIDL).
 
.
 
.

Revision as of 08:35, 20 June 2018

This is a short overview of standards for directories.

Unix based

There are 2 important standards, which have their own scope:

FHS

The Filesystem Hierarchy Standard (FHS) defines the general directory layout of a computer system. It is currently maintained by The Linux Foundation at https://wiki.linuxfoundation.org/lsb/fhs. Before it was at http://www.pathname.com/fhs/ maintained by the Linux Standard Base (LSB) workgroup of freestandards.org.

The different BSD variants are no longer part. They use only
man hier(7)
.

XDG

The former X Desktop Group is today known as Freedesktop.org. Its XDG Base Directory Specification defines some rules for the home directory.

XDG variable Default Notes
$XDG_CONFIG_HOME $HOME/.config the base directory relative to which user specific configuration files should be stored.
$XDG_CONFIG_DIRS /etc/xdg the colon ':' seperated preference-ordered set of base directories to search for configuration files in addition to $XDG_CONFIG_HOME
$XDG_DATA_HOME $HOME/.local/share the base directory relative to which user specific data files should be stored.
$XDG_DATA_DIRS usr/local/share/:/usr/share/ the colon ':' seperated preference-ordered set of base directories to search for data files in addition to $XDG_DATA_HOME
$XDG_CACHE_HOME $HOME/.cache the base directory relative to which user specific non-essential data files should be stored.
$XDG_RUNTIME_DIR If it is not set applications should fall back to a replacement directory with similar capabilities and print a warning message. Applications should use this directory for communication and synchronization purposes and should not place larger files in it, since it might reside in runtime memory and cannot necessarily be swapped out to disk...

Partly the home directory uses similar subdirectories as the system has, some with the same name like /usr/share vs. ~/.share, others with a different name like /etc vs. ~/.config. This will allow among others a fallback: if no value is found in ~/.config check /etc for the system wide default.

MS-DOS based

The KNOWNFOLDERIDs replaced in Vista the former constant special item ID list (CSIDL). .