GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

✨ GOLF(2gg) β€” Development πŸ’…

okay bestie, welcome to the GOLF(2gg) manual, Development section, and today's main character is rename-file. buckle up πŸŽ€


🌸 NAME 🌸

rename-file β€” (files)


πŸ¦‹ PURPOSE πŸ¦‹

Renames a file. that's it. that's the whole vibe. ✨


πŸ’– SYNTAX πŸ’–

rename-file <from file> to <to file> [ status <status> ]

πŸ‘‘ DESCRIPTION πŸ‘‘

so like, rename-file will rename <from file> to <to file>. periodt. πŸ’…

the <status> number it hands you back is GG_OKAY when everything slays, and GG_ERR_RENAME when it does not. no cap.

now here's the part where you gotta pay attention, bestie: <from file> and <to file> must be given with full paths β€” unless they're chillin' in the current working directory (peep directories for that), in which case a name all by itself is totally enough. 🫢

and the iconic part? <from file> and <to file> can live in different directories. we love a cross-directory moment. πŸ”₯


πŸŽ€ EXAMPLES πŸŽ€

Rename files:

rename-file "/home/u1/d1/f1" to "/home/u1/d2/f2" status st
if-true st equal GG_OKAY
    @Rename successful. <br/>
end-if

Rename files in the current working directory:

rename-file "f1" to "f2" status st
if-true st equal GG_OKAY
    @Rename successful. <br/>
end-if

🌈 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 see all documentation πŸ’œ


and that's the whole page, bestie!! 🧚 this little baddie is dated $DATE and running version $VERSION, brought to you by the GOLF(2gg) manual. go rename something. ate. πŸ“βœ¨

πŸ“¦ where this page comes from