AFCLOSEFILE(3)

πŸ’– AFCLOSEFILE πŸ’–

okay so bestie, you're in section 3 of the manual (that's the library-functions girlies, iykyk) and today's main character is afCloseFile β€” the one that closes an open audio file. yes. that's the whole vibe. closing. it's giving closure, literally 🫢


✨ NAME ✨

afCloseFile β€” close an open audio file 🌸


✨ SYNOPSIS ✨

#include <audiofile.h>

int afCloseFile(AFfilehandle file);

✨ PARAMETERS ✨

  • file β€” a valid file handle created by afOpenFile(3). valid is doing a lot of heavy lifting in that sentence bestie, don't come in here with a random handle and expect magic πŸ’…

✨ DESCRIPTION ✨

afCloseFile closes the audio file file. that's it. that's the job. πŸŽ€

and here's the cute part: if the file was opened for writing, closing it also updates the file. so like, the close is not just a goodbye, it's also the part where your changes actually get written down. no cap. the way that closing is lowkey load-bearing for writers… obsessed 😭


✨ RETURN VALUE ✨

  • 0 β€” the file was closed properly. slay. ✨
  • -1 β€” an error occurred while closing the file. πŸ’€

✨ ERRORS ✨

afCloseFile can generate these possible errors:

  • AF_BAD_FILEHANDLE
  • AF_BAD_LSEEK
  • AF_BAD_WRITE
okay so these are the three little gremlins that can pop up. no further lore is provided, so we don't make any up. periodt πŸ™ˆ

✨ SEE ALSO ✨

  • afOpenFile(3) β€” the one that started it all, the origin story 🌈

✨ AUTHOR ✨

Michael Pruett <michael@68k.org> β€” the icon, the moment, the author πŸ‘‘


and that's the whole page bestie!! you now know how to close a file correctly, which is more than most people can say. go forth and afCloseFile responsibly. mwah πŸ’‹

Audio File Library 0.3.6 Β· 03/06/2013 β€” yeah she's vintage but she's still serving, and this manual page is AFCLOSEFILE(3) through and through. byeeee πŸ¦‹

πŸ“¦ where this page comes from