GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

✨ GOLF(2gg) β€” directories ✨

okay bestie, welcome to the Golf docs for general directories πŸ’– this is the part of the Development manual where we talk about where stuff lives on your machine. sit down, grab a strawberry πŸ“, let's get into it.


🌸 NAME 🌸

directories β€” Golf documentation (general directories). yes that's the whole name section, she's short and she ate πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

πŸ‘‘ ROOT DIRECTORY πŸ‘‘

ok so. the root directory is the directory where Golf is installed. every single directory path described below gets appended to the root directory. periodt.

when Golf is installed with a system installer β€” think apt, dnf, zypper, pacman etc. β€” then the root directory is literally an empty string (""). iconic.

when Golf is installed locally, into a specific directory, that directory is the root. for example, if you installed Golf into your user's home directory, it might be "$HOME/.app/golf". no cap.

if you're using any of the paths below in the absolute form (which, in most cases, you don't need to, since your application's current working directory is the application home directory below), you should first get your root directory (even if it's empty):

get-app root-directory to root
read-file root + "/var/lib/gg/<app name>/app/my-file" to contents

slay. moving on πŸ’…

🧚 APPLICATION DIRECTORY STRUCTURE 🧚

mgrg will create a Golf directory structure (peep the "-i" option) when you create your application. and listen β€” while you can keep and compile Golf source files in any directory, the directories used by Golf are always under /var/lib/gg. that's just the vibe.

a Golf application is always owned by a single Operating System user (see the "-u" option in mgrg), while different applications can be owned by different users. it's giving one app, one owner, no drama. here's the directory structure:

  • /var/lib/gg/bld/<app name> β€” the Build directory πŸ—οΈ is where your application executables are built, with the name <app name>.srvc for a service and <app name> for a command-line program. this is a scratch-pad directory, so do not alter files in it, or use it for anything else. it is created with 755 privileges.
  • /var/lib/gg/<app name> β€” the Application directory πŸ“. all application data, including internals such as sockets, are kept here. it is created with 755 privileges, while each subdirectory within (see below) is created with 700 privileges in order to prevent other users (even from the same group) from accessing its files. protective queen behavior πŸ”’
  • /var/lib/gg/<app name>/app β€” the Application home directory 🏠. this is the current working directory when your application runs. copy/move here any files and directories your application needs.
  • /var/lib/gg/<app name>/app/file β€” this is file-storage used for uploads and new document creation. do not write there directly; Golf does that for you, such as with uniq-file for instance, or when uploading files. let the app cook 🍳
  • /var/lib/gg/<app name>/app/trace β€” Process tracing is written in per-process files if the "--trace" option is used (see gg). note that a special file "backtrace" is appended to when the program crashes (or when the report-error statement is used), and this file shows a full source backtrace, allowing for easier debugging. you can use "--c-lines" in order to show the source code lines of the generated C code, instead of Golf code. debugging but make it glam ✨
  • /var/lib/gg/<app name>/app/db β€” the Database configuration directory πŸ’Ύ contains the database-config-files used by Golf to connect to databases; this directory is maintained by Golf and you should not use it. hands off, bestie πŸ™ˆ

while Golf directories are fixed, you can effectively change their location by creating a soft link. this way, your directories and files can be elsewhere, even on a different disk. for example, to house your file storage on a different disk:

ln -s /home/disk0/file /var/lib/gg/<app name>/app/file

the way that a symlink just solves all your problems… obsessed πŸ¦‹


🌈 SEE ALSO 🌈

Directories

  • change-dir change-mode delete-dir directories new-dir

General

  • about-golf directories permissions See all documentation

and that's the whole page, bestie πŸ’– you now know exactly where every Golf thing lives and why. go forth and ln -s responsibly 🫢

this page is from Golf version $VERSION, dated $DATE, and she's filed under GOLF(2gg) in the Development manual β€” periodt β­πŸ‘‘
πŸ“¦ where this page comes from