GOLF(2gg)
πΈ GOLF(2gg) β the Development manual, bestie edition π
okay so welcome to the GOLF section 2 pages, and today's main character is change-dir β¨ it lives in the (directories) group and honestly? it's giving "let's move house but make it a syscall" π
β¨ NAME β¨
change-dir β (directories) π¦
π PURPOSE π
Change current working directory. that's it, that's the whole vibe. no cap. π«Ά
π SYNTAX π
change-dir [ <directory> | home | run-dir ] [ status <status> ]
π DESCRIPTION π
change-dir will change current working directory to <directory> (which is a string that can be an absolute or relative path), or to application home directory (see directories) if home clause is used. so like, pick a path or just say "home" and it handles it for u π β¨
If run-dir clause is used, then current working directory is changed to the directory where you ran the program from. note that this only applies to command-line programs. If you program runs as a service, then this clause has the same effect as home clause. so service girlies get home dir energy regardless, iykyk π
If status clause is used, then number <status> is GG_OKAY if change-dir is successful, or GG_FAILED if not (in which case you can use errno clause in get-req to find the specific reason why). literally the receipts, bestie π§Ύ
β οΈ Note that if you change current working directory with call-extended, then you must set Golf internal boolean variable gg_path_changed to true. do NOT skip this one, it's not a suggestion, it's the rules fr fr π
π EXAMPLES π
change-dir "/home/user/new_dir" status s
if-true s equal GG_OKAY
@Directory changed
else
get-req errno to eno
@Error <<print-out eno>>
end-if
Use relative path: π¦
change-dir "./new_dir"
Go back to application home directory: π π
change-dir home
π SEE ALSO π
- Directories
change-dir change-mode delete-dir directories new-dir β See all documentation π
this page was brought to you by $VERSION, dated $DATE πΈ mwah, go change some directories, you absolute icon π
β¨
π¦ where this page comes from
- ubuntu questing: golf 601.4.41-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms