GFS_UNLINK(3)

okay so bestie, welcome to gfs_unlink, a little function from Gfarm (manual section 3, the library-call girlies πŸŽ€) that is genuinely SO useful and I need you to be obsessed with it. it's giving "delete that file, periodt."


✨ NAME ✨

gfs_unlink β€” delete a file πŸ—‘οΈβœ¨


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gfarm/gfarm.h>

gfarm_error_t gfs_unlink(const char * gfarm_url);

like. that's it. that's the whole vibe. one arg, one job, main character energy fr fr πŸ’–


🌸 DESCRIPTION 🌸

so gfs_unlink() deletes the file whose name is the string specified by gfarm_url. that's the entire plot bestie, no subplot, no twist, just poof and it's gone πŸ’€

ngl it's lowkey iconic how simple it is. one function, one file, no cap.


⭐ RETURN VALUES ⭐

okay so here's where you gotta pay attention, because the return value is the vibe check and you do NOT want to ignore it πŸ™ˆ

  • GFARM_ERR_NO_ERROR β€” slay!! ✨ the function terminated successfully, everything ate, no crumbs left. this is the good one, this is the one we want πŸ’–
  • GFARM_ERR_NO_MEMORY β€” insufficient memory was available 😭 the function literally could not, it's out here starving for RAM. not its fault, it's the machine's fault.
  • GFARM_ERR_AUTHENTICATION β€” user authentication failed when connecting to gfmd(8) πŸ” so like... who are you?? the server said "I don't know her" πŸ’…
  • GFARM_ERR_PERMISSION_DENIED β€” gfarm_url points outside your accessible address space 🚫 not your territory, not your business, back up bestie.
  • GFARM_ERR_NO_SUCH_OBJECT β€” gfarm_url does not exist πŸ«₯ you're trying to delete a ghost, and not the cute kind. it was never there. it's giving "delulu."
  • GFARM_ERR_NOT_A_DIRECTORY β€” a component of the path prefix is not a directory 🀨 the path is lying to you, some middle piece isn't what it claims to be. caught in 4K.
  • Others β€” an error except the above occurred. the reason is shown by gfarm_error_string(3) πŸ” so go read that one, it'll spill the tea for you.
πŸ’€ real talk: Others is the catch-all and it means anything else happened, so don't guess β€” call gfarm_error_string(3) and let it tell you the actual reason. no assumptions, no guessing, we don't do that here.

πŸ‘‘ a lil sign-off

this page comes to you from Gfarm, dated 20 Jun 2019 πŸŽ€ and yeah the footer is a little retro but honestly? vintage. timeless. ate. now go delete some files responsibly, bestie, and remember to check your return values πŸ’–βœ¨πŸ¦‹