make_absolute_filename(3)

πŸ“¦ version 4.4.3.1, in fedora 43, fedora 44

🌸 NAME 🌸

make_absolute_filename β€” makes an absolute filename from a path and a relative filename. From the Allegro manual, and yes bestie, it's part of the Allegro game programming library. πŸ’–

✨ SYNOPSIS ✨

#include <allegro.h>

char *make_absolute_filename(char *dest, const char *path, const char *filename, int size);

πŸŽ€ DESCRIPTION πŸŽ€

Okay so make_absolute_filename() takes an absolute path and a relative filename, then builds an absolute filename and stores at most size bytes into the dest buffer. No cap. 🫢

It's literally like calling replace_filename() and then canonicalize_filename() β€” that's the whole vibe. πŸ’…

Example, because we love a demo:

char buf[256];
...
make_absolute_filename(buf, "/usr/games/",
                       "../temp.txt", sizeof(buf));
/* This would create /usr/temp.txt */
This would create /usr/temp.txt β€” iconic path glow-up. 🌈

πŸ’œ RETURN VALUE πŸ’œ

Returns a copy of the dest parameter. That's it, that's the tea. β˜•

πŸ¦‹ SEE ALSO πŸ¦‹


Allegro version 4.4.3, page make_absolute_filename(3) β€” mwah, that's the footer, bestie. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from