FcDirCacheUnlink(3)

okay so this is a fontconfig manual page, section 3 (library functions, bestie 🫢), and it's literally about yeeting cache files. stay with me, it's short and it slaps.


🌸 NAME 🌸

FcDirCacheUnlink β€” remove all the caches related to dir 🧹✨

like, every single one. no crumbs left. periodt.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <fontconfig/fontconfig.h>

FcBool FcDirCacheUnlink (const FcChar8 *dir, FcConfig *config);

πŸ’– DESCRIPTION πŸ’–

okay so the vibe is: it scans the cache directories in config πŸ‘€ and removes any instances of the cache file for dir. that's it, that's the whole function. she goes through config's cache dirs looking for the cache belonging to dir and just deletes them πŸ’€

it returns FcFalse when some internal error occurs β€” like out of memory, etc. 😭 so like, the function itself being sad gives you a FcFalse.

but here's the key detail, and it's giving "we don't care energy": errors actually unlinking any files are ignored. πŸ«₯ like if unlink() fails? not her problem. she said "i tried πŸ’…" and moved on. the return value is not telling you about file-removal failures β€” only about internal errors.

ngl that last bit is the part people get wrong, so like, don't @ me when your files are still there and the return was FcTrue, iykyk.

🌈 a little recap for the girlies 🌈

  • input dir β†’ the directory whose caches get wiped πŸŽ€
  • input config β†’ the config whose cache directories get scanned πŸ”
  • returns FcBool β†’ FcFalse on internal errors (oom, etc), otherwise you're good ⭐
  • unlink errors β†’ ignored, no cap πŸ™ˆ

πŸ‘‘ sign-off πŸ‘‘

this iconic little page came to you from Fontconfig 2.17.0, dated 27 June 2025 πŸ’œ she's giving library-function realness, she's giving "delete the cache and don't stress", and honestly? obsessed. mwah πŸŽ€πŸ”₯

πŸ“¦ where this page comes from