GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

🌸 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