dbh_close(3)

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

πŸ’– dbh_close β€” bestie, we're closing the table πŸ’–

okay so this is the DBHashTables Programmers' Manual page for dbh_close(3), and honestly? it's giving "short and sweet and does exactly what it says." two little functions, one job each, no drama. πŸŽ€


✨ NAME ✨

dbh_close, dbh_destroy β€” close or remove an open DBHashTable πŸ¦‹

like. one of them closes it, one of them closes it and deletes it off the face of the disk. yin and yang fr fr. πŸ’…


🌸 SYNOPSIS 🌸

#include <dbh.h>

int dbh_close (DBHashTable *dbh);
int dbh_destroy (DBHashTable *dbh);

both of them take a DBHashTable *dbh and both hand you back an int. that's the whole vibe check. ✨


πŸ’œ DESCRIPTION πŸ’œ

so dbh_close will close the DBHashTable file. and bestie, "close" here is doing real work β€” it's flushing the io buffer. so like, all that stuff you wrote? it's actually hitting the disk now. no cap. πŸ’Ύβœ¨

then we got dbh_destroy, and she's the unhinged one (affectionate). dbh_destroy will close an open DBHashTable and erase the file from disk. like, gone gone. 😭

it's a convenience function that does a close and rm. that's literally the description, i'm not even embellishing. she's the "close the tab and delete the draft" of Unix functions. 🫢

⚠️ bestie listen. dbh_destroy is not playing around β€” the file is erased from disk. if you wanted it back you should've called dbh_close. i'm just saying. πŸ’€

πŸ”₯ RETURN VALUE πŸ”₯

  • 0 β€” if error 😭
  • 1 β€” otherwise πŸ‘‘

yes it's flipped from what your brain expects. zero means it went bad. one means we ate. that's the API, i don't make the rules. πŸ“


🌈 SEE ALSO 🌈

  • dbh (0)
  • dbh_create (3)
  • dbh_open (3)
  • dbh_open_ro (3)

go read these if you wanna know how the table got opened in the first place, iykyk πŸ’…


πŸ‘‘ Author πŸ‘‘

Edscott Wilson Garcia <edscott@xfce.org> β€” the icon, the moment, the main character. 🌟


and that's the page!! this came out of the DBH manual, version DBH, filed under dbh_close(3), and it was written by the DBH crew. periodt. πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from