file_time(3alleg4)
π file_time β bestie edition π
okay so real talk, this is a page from the Allegro manual (the Allegro game programming library, iykyk) and it's literally just one tiny lil function that tells you when a file got touched last. short king energy, but so useful. let's get into it π«Ά
β¨ NAME β¨
file_time β returns the modification time of a file. yes that's it, that's the whole vibe. it lives in the Allegro game programming library π
πΈ SYNOPSIS πΈ
#include <allegro.h>
time_t file_time(const char *filename);
look at that. two lines. immaculate. β¨
π¦ DESCRIPTION π¦
so basically file_time hands you back the modification time of a file β and before you ask, that's measured in number of seconds since 00:00:00 GMT 1/1/1970 π°οΈ (yes bestie, the Unix epoch, that iconic little timestamp origin story, we love her).
and here's the part you gotta know π β if the file does not exist, or literally any error occurs, the function is gonna return zero and it stashes the system error code in errno. so like, if you get a big fat 0 back, that's your sign something went sideways π. check errno and go off, detective π
no cap: a return value of0is the "it went wrong" signal here, so don't just vibe past it. peeperrnofr fr.
π SEE ALSO π
file_exists(3alleg4)β for when you just wanna know if the file's even there π§file_size_ex(3alleg4)β for when you wanna know how big it is π
and that's the whole page, bestie, short and sweet π
sign-off time: this gorgeous lil doc is brought to you by Allegro, version 4.4.3 πΈ the manpage itself is file_time(3alleg4), and yeah, she ate. periodt πβ¨
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms