GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’… GOLF(2gg) β€” the golf manual, dev section, bestie edition

okay so this is a page from the GOLF manual, section 2gg, and it lives in the Development corner of the docs. it's giving reference material, it's giving "i read the manual", we love that for us. πŸŽ€


✨ NAME ✨

uniq-file β€” it's a files thing πŸ—‚οΈ


🎯 PURPOSE 🎯

make a brand-new, empty file with a name that's unique. that's it. that's the whole job. πŸ’–


πŸ“ SYNTAX πŸ“

uniq-file <file name> [ temporary ]

πŸ¦‹ DESCRIPTION πŸ¦‹

so, like, one of the most common lil tasks in basically every application ever is creating a unique file β€” any kind, temporary included. and the uniq-file statement does exactly that, no cap. it creates a new unique file of zero size, and <file name> is its fully qualified name, which is always inside the file-storage. always. every time. 🫢

the file itself gets created empty. and if you use the temporary clause, then the file that gets created is a temporary-file. simple as that. ✨

the file has no extension. none. zero. nada. but bestie, you can rename it after it's been created so it actually reflects what it's for or what it does. go off. πŸ’…

and every single file created this way gets set up with owner and group read/write only permissions. that's the vibe. πŸ”’


🌈 EXAMPLES 🌈

okay so this first one creates an empty file with an auto-generated name that gets stored in the mydoc variable. the string variable mydoc is defined in the statement itself (cute, right?). then the string "some data" gets written to that freshly created file:

uniq-file mydoc
write-file mydoc from "some data"

and this one is for when you wanna create a temporary file:

uniq-file temp_file temporary
...
// use file named "temp_file"
..
delete-file temp_file

πŸ‘€ SEE ALSO πŸ‘€

Files

change-mode close-file copy-file delete-file file-position file-storage file-uploading lock-file open-file read-file read-line rename-file stat-file temporary-file uniq-file unlock-file write-file

and also See all documentation if you wanna go on a whole lil reading journey. πŸ“šβœ¨


this page is version $VERSION, dated $DATE, and it's filed under GOLF(2gg) in the manual. mwah, thanks for reading bestie, go create some files responsibly πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from